On Friday, Sep 26, 2003, at 17:02 Europe/Lisbon, Dinu Gherman wrote: > I'm sorry, but I won't have the time for doing the appropriate > research first, so I have to ask quickly: has anyone a short > sample for doing something like running a Python script that > either calls an existing Applescript or does the same thing > via OSA-whatever to run an app like SnapZ Pro X, say, and tell > it to make a screenshot of some window, say, maybe even using > some parameters...? > If you don't want to mess around with gensuitemodule, just open a pipe to osascript. You can either give your AppleScript to osascript as strings, or as a file name. Here's a little example using strings: MACUNIXSCRIPT = """osascript -e 'return POSIX path of "%s"'""" UNIXMACSCRIPT = """osascript -e 'return (POSIX file "%s") as string'""" import os def mac2unix(mpath): return os.popen(MACUNIXSCRIPT % mpath).readline()[:-1] def unix2mac(upath): return os.popen(UNIXMACSCRIPT % upath).readline()[:-1] Hope that helps, Michael
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4