Re: Possible bug with AppScript and Excel?
Re: Possible bug with AppScript and Excel?
- Subject: Re: Possible bug with AppScript and Excel?
- From: Tommy Bollman <email@hidden>
- Date: Thu, 29 Jul 2010 15:50:20 +0200
Hello.
There is a recent thread at the AppleScript OsX section of macscripter.net which may or may not help you.
On 29 Jul 2010, at 15:43, Christian Prinoth wrote:
> Hi, I am having some problems handling axes in Excel charts via python and
> appscript.
>
> I am using apple's stock python 2.6.1, appscript 0.21.1 and Excel 12.2.5 on
> Snow Leopard 10.6.4
>
> Here is how I am trying to get hold of an axis:
>
> *c=app('Microsoft
> Excel').get_axis(app.active_sheet.chart_objects[1].chart,axis_type=k.value_axis)
> *
>
>
> now c contains
>
> *app(u'/Applications/Microsoft Office 2008/Microsoft
> Excel.app').active_sheet.chart_objects[1].chart.axes.ID(131073)*
>
>
> but if I do:
>
> *c2=app('Microsoft Excel').get_axis(app.active_chart,axis_type=k.value_axis)
> *
>
>
> apparently I get the same result, in fact c==c2 returns true. Yet, if I try
> to access c, I get an error, eg
>
> *In [16]: c.maximum_scale()*
> *------------------------------------------------------------*
> *Traceback (most recent call last):*
> * File "<ipython console>", line 1, in <module>*
> * File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line
> 643, in __call__*
> * return self.get(*args, **kargs)*
> * File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line
> 499, in __call__*
> * raise CommandError(self, (args, kargs), e, self.AS_appdata)*
> *CommandError: Command failed:*
> * *
> *OSERROR: -1728*
> * *
> *MESSAGE: The object you are trying to access does not exist*
> * *
> *COMMAND: app(u'/Applications/Microsoft Office 2008/Microsoft
> Excel.app').active_sheet.chart_objects[1].chart.axes.ID(131073).
> maximum_scale.ge*t()
>
>
> but c2 works perfectly:
>
> *In [17]: c2.maximum_scale()*
> *Out[17]: 0.080000000000000016*
>
>
> Does anyone know what I am doing wrong or if there is a bug somewhere?
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
Best regards
Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden