In article
<CAGMDJTuDHeiGK2CZ7iRx_hP+ahbktR=yhtzvuv3mycwdeyq...@mail.gmail.com>,
Adam Morris <[email protected]> wrote:
> I posted a question a few months ago and didn't quite get the answer I
> was looking for, so this is my second attempt.
>
> I need the following applescript translated into python appscript:
>
> tell application "Finder" to "/path/to/file" as POSIX file as alias
>
> The earlier answer given was:
>
> mactypes.Alias("/path/to/file")
>
> But this is not sufficient, because I'm looking for the "Finder
> reference form", and it seems that mactypes.Alias returns an "alias
> reference form" (See here for context on those terms:
> http://macscripter.net/viewtopic.php?id=24575)
>
> The ugly solution I'm using now is to manually build the Finder
> reference form by parsing the string (folder('path').folder('to')),
> and this is not sufficient either, because there are folders (such as
> the /tmp folder) that are not "visible" to the Finder and so fail.
Try this reference form:
app("Finder").items[mactypes.Alias("/path/to/file")]
--
Ned Deily,
[email protected]
_______________________________________________
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG