I’m trying to program an app in Applescript Studio. However, it is refusing to compile, giving an “Expected end of line but found identifier” error. I’m trying to make my app send a keystroke which would enable black-on-white mode in OS X. Any idea how to make it work? line in question is in bold.
on clicked theObject
if name of theObject is “settings” then
if panelWIndow is equal to missing value then
set panelWIndow to window “settingspanel”
end if
else if name of theObject is “lightSwitch” then keystroke “8” command option control down
end if
--Pop open the panel as a drop-down panel.
display panel panelWIndow attached to window "main"
“keystroke” is a keyword in System Events’ dictionary. So, adding → tell app “System Events” to blah ← will be very useful Also make sure “Enable access for asistive devices” is checked in your Universal Access > Seeing preference pane.
I think you could also use “CGPostKeyboardEvent” from a “call method”, but I can’t help you with this cocoa thing