0
votes

My applescript isn't working. I want a keystroke that does ⌘+ on my mac. Here is my current code.

set abc to "+"
tell application "System Events"
keystroke command & abc
keystroke a
end tell

When I click play, I get the error

"System Events got an error: Can’t make {command, \"n\"} into type text." number -1700 from {command, "n"} to text.

Anyone know how to fix this?

1

1 Answers

1
votes

The syntax to press modifier keys is

set abc to "+"
tell application "System Events"
  keystroke abc using command down
end tell