[Pythonmac-SIG] translate applescript to appscript

Adam Morris amorris at mistermorris.com
Thu Jun 30 13:52:04 CEST 2011


I have an AppleScript snippet that I need translating to python
appscript; too low-level for ASTranslate to handle:

tell application "Finder"
	"/Users/brainysmurf/Desktop" as POSIX file as alias
end tell

I'm writing a wrapper class for the Finder and want to be able to pass
/path/to/doc to its methods and so I need a way to convert from paths
to file objects that the Finder can do things with. Reading the docs I
tried:

appscript.app("Finder").AS_newreference(appscript.app.elements('psxf').byname('/Users/brainysmurf/Desktop'))

But I get an error saying that elements is not an attribute. I get the
same deal with appscript.app('Finder').

Using appscript 1.0.0

Help?

-Adam


More information about the Pythonmac-SIG mailing list