this is what i wanted to do:
When executing the script, a dialog comes up with the question: start script? when pressing "ok" the script will run. (easy)
I want to make the script do the following thing:
Absolutely nothing untill i press the key "K" on my keyboard. then it will move the mouse to a specific area of the screen, in my case (320, 250) (top left to bottom right X, Y).
So i came up with the following script:
Someone please help me? i really need to finish this script fast.
Thanks,
Timen Dillema.
When executing the script, a dialog comes up with the question: start script? when pressing "ok" the script will run. (easy)
I want to make the script do the following thing:
Absolutely nothing untill i press the key "K" on my keyboard. then it will move the mouse to a specific area of the screen, in my case (320, 250) (top left to bottom right X, Y).
So i came up with the following script:
but It doesnt do what i want it to do. apparently the "keyboardviewerserver" app cant recognize the key "K" when other keys are pressed at the same time, and i DO want it to be able to do that. Also, when i try to use the command "click mouse" after "move mouse {320, 250}" the whole script FLIPS and starts randomly clicking and moving the mouse, and the script editor crashes.set answer to button returned of (display dialog "start script?" buttons {"start script", "quit"} default button 1)
if answer is "start script" then
repeat
tell application "System Events"
try
tell application "KeyboardViewerServer" to activate
set shift1 to (get value of checkbox "K" of front window of application process "KeyboardViewerServer") as boolean
if shift1 is true then
move mouse {320, 250}
end if
end try
end tell
end repeat
end if
Someone please help me? i really need to finish this script fast.
Thanks,
Timen Dillema.