[Pythonmac-SIG] appscript path issue
Bill Janssen
janssen at parc.com
Wed Mar 4 21:56:50 CET 2009
Bill Janssen <janssen at parc.com> wrote:
> I'm trying to write this scrap of Applescript in Python appscript:
>
> on run
> tell application "Microsoft PowerPoint"
> set this_item to path of active presentation
> end tell
> set unix_item to POSIX path of this_item
> display dialog of unix_item
> end run
>
> which yields "/tilde/janssen/Documents", an NFS-mounted location.
>
> I've got this:
>
> from appscript import *
> from mactypes import *
> print File.makewithhfspath(app("Microsoft PowerPoint").active_presentation.path()).path
>
> However, in this case, I get "/janssen/Documents", which is wrong.
>
> So, how do I get the effect of "POSIX path of" in appscriptpt?
>
> This is appscript 0.19.0 on 10.5.6, with /usr/bin/python.
And osascript seems to get this right, too:
% osascript -e 'POSIX path of "janssen:Documents"'
/tilde/janssen/Documents
%
Bill
More information about the Pythonmac-SIG
mailing list