[Pythonmac-SIG] appscript equivalent of launch?

Kevin Walzer kw at kevin-walzer.com
Thu Jul 20 16:10:29 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

has wrote:
> Robert Stephenson wrote:
> 
>> As far as I can see, appscript lacks an equivalent of Applescript's  
>> launch verb, which opens an app without running it (useful for apps  
>> like Textedit or Keynote that create default documents when they  
>> run).  Did I miss something, or how can you open a file without the  
>> default run action?
> 
> Appscript does implement a built-in launch command:
> 
> app('textedit').launch()
> 
> However, it doesn't work at all right, so don't bother trying it. The  
> only way I can currently think of doing it is to use AS:
> 
> import osax
> osax.runscript('launch app "TextEdit"')
> 
> 
> If anyone knows how to launch apps without them being sent the  
> customary run event then please let me know.
> 
> has

How about:

import os

os.system('open -a TextEdit.app')



- --
Kevin Walzer
Poetic Code
http://www.kevin-walzer.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFEv47VrTC5hIgjqTMRArHGAKCnoyiNNrLBccXwQqx2sb9I8LpN6ACY/Vts
msULOdVrL+tdEPsVaI+gww==
=QymW
-----END PGP SIGNATURE-----


More information about the Pythonmac-SIG mailing list