osascript - How to indent applescript when running in bash script? -


osascript -e "set x 3" osascript -e "if x 5 then" osascript -e "    tell application \"system events\" keystroke return" osascript -e "end if" 

the output get

14:14: syntax error: expected end of line found end of script. (-2741) 0:6: syntax error: “if” can’t go after “end”. (-2740) 

can't see whats wrong script. might issue indentation. used osascript inside bash files ?

put applescript lines together. way:

osascript -e "set x 3 if x 5 tell application \"system events\" keystroke return end if" 

additionally, can create file following applescript code:

#!/usr/bin/osascript set x 3 if x 5     tell application "system events" keystroke return end if 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -