Can someone show me how to pass a variable into an Applescript using osascript in python? I've seen some documentation/samples on doing this but I'm not understanding it at all.
Here is my python code:
# I want to pass this value into my apple script below
myPythonVariable = 10
cmd = """
osascript -e '
tell application "System Events"
set activeApp to name of first application process whose frontmost is true
if "MyApp" is in activeApp then
set stepCount to myPythonVariableIPassIn
repeat with i from 1 to stepCount
DoStuff...
end repeat
end if
end tell
'
"""
os.system(cmd)