IMcD23
IMcD23

Reputation: 445

Shell Script variables within multiple quotes

I am running the following line within a shell script:

osascript -e 'tell application "System Events" to keystroke "$1"'

I want to be able to type the $1 using applescript. Is there any way for the $1 to come out as what I type in to the terminal after the script? Now, it just types literally $1.

Upvotes: 2

Views: 3275

Answers (1)

jaypal singh
jaypal singh

Reputation: 77185

Put them in single quotes, like this -

osascript -e 'tell application "System Events" to keystroke '$1''

Upvotes: 4

Related Questions