Getting Variable from Applescript and using in Python -
is there easy way use applescript like:
set thetext text returned of (display dialog "please insert text here:" default answer "" title "exchange python" icon 1)
and use "thetext" variable in python?
you can run python script command line input applescript:
--make sure escape if needed set pythonvar "whatever" set outputvar (do shell script "python '/path/to/script' '" & pythonvar & "'")
ned's example has python calling applescript, returning control python, other way around. in python access list of parameters:
import sys var_from_as = sys.argv[1] # 1rst parameter cause argv[0] file name print 'this gets returned applescript' # gets set outputvar
Comments
Post a Comment