[proFit-list] changing x and y axis range with applescript?
pro Fit Support
profit at quansoft.com
Tue Dec 7 22:11:19 CST 2010
Dear Dave
This is a good question. In fact, it points to an error we have to fix. For the moment, as a work-around, use the "do script" and "evaluate" commands to get/set the axis range:
tell application "pro Fit"
-- the following sets the start coordinate of the x-axis of the first curve of the current graph
set xFirst to -2.1243234
do script "SetAxisProperties(axis GetPlotProperty(1, xAxis), first" & xFirst & ")"
-- the following gets the start coordinate
set xFirst to evaluate "GetAxisProperty(GetPlotProperty(1, xAxis), first)"
end tell
Best regards
Kurt Sutter
QuantumSoft
On 7 Dec 2010, at 5:25, Dave wrote:
> Hi Kurt,
> That's progress, but I'm still running into trouble. I can't seem to access any of the properties of a curve. One thing I'm wondering, are "first" and "last" reserved keywords in Applescript?
>
> See below. Thanks!
>
> Dave
>
>
> tell application "pro Fit 6.2.1"
> -- these compile but don't execute
> get line dash of xAxis of curves 1 of shape "1" of window 1
> get name of xAxis of curves 1 of shape "1" of window 1
> set ax to xAxis of curves 1 of shape "1" of window 1
> -- these don't compile
> get first of xAxis of curves 1 of shape "1" of window 1
> set first of ax to -10
> end tell
>
> Error:
>
> error "pro Fit 6.2.1 got an error: Cannot handle this object class. [System error -1723]" number -1723 from line dash of xAxis of curves 1 of shape "1" of window 1
>
> On Dec 6, 2010, at 8:41 PM, Kurt Sutter wrote:
>
>> Dave
>>
>> Try
>>
>> get xAxis of curves 1 of shape "1"
>>
>> Regards
>>
>> Kurt Sutter
>> QuantumSoft
>>
>> On 6. Dec 2010, at 17:12, Dave wrote:
>>
>>> Hi all,
>>>
>>> I'm trying to write an applescript that will change the Y1 and Y2 range of a graph.
>>>
>>> I see that a graph is represented by the "shape" class, and I figure if I can get the first curve of that, I can get the axis to which it is associated. An "axis" class has properties "first" and "last" which denote the start and end coordinate of that axis, respectively.
>>>
>>> However, my plan is hitting a snag. I can't seem to get the first curve of a shape:
>>>
>>> set curveBall to curves 1 of shape "1"
>>>
>>>
>>> error "pro Fit 6.2.1 got an error: Apple event was not handled. [System error -1708]" number -1728 from curves 1 of shape "1"
>>>
>>> I can't even find what error -1728 means. Am I accessing the "curves" property correctly? Is this a reasonable way to get to the axes to change their range?
>>>
>>> Any and all help, much appreciated.
>>>
>>> Dave
>>>
>>> _______________________________________________
>>> proFit-list mailing list
>>> proFit-list at quantum-soft.com
>>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
>>
>> _______________________________________________
>> proFit-list mailing list
>> proFit-list at quantum-soft.com
>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
>
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20101208/aac99dc4/attachment.html>
More information about the proFit-list
mailing list