LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simulate keystroke mac

Hi,
I have a program which uses the System Exec vi to execute a program via terminal.  Every once in awhile, the terminal program will mess up.  The LV program I wrote checks for an error out from the System Exec vi.  The LV program works fine, but in order to stop the program running in terminal, I need to send the keystroke command Control C to abort the program.  I tried to type cast the ascii value of the "^" and concatenate that with "C" but it does not work.  I also tried to use the ascii value of 3, because the control key subtracts 64 from the ascii value of "C", which is 67.  I found a vi on the forums which simulated keystroke in Windows, but is there anyway to simulate keystrokes on the Mac?
 
Adam
0 Kudos
Message 1 of 3
(2,594 Views)

Hi Shivels,
I believe the way to do this is through UI scripting.  I haven't actually performed automated keystrokes on a MAC, but the links below should give you the resources you need to get you up and running.

http://www.mactech.com/articles/mactech/Vol.21/21.06/UserInterfaceScripting/index.html
http://www.apple.com/applescript/uiscripting/

Reggie Rector ¦ Applications Engineer ¦ National Instruments

0 Kudos
Message 2 of 3
(2,576 Views)
Thanks for the info.  I will give it a try tomorrow.
 
Thanks again,
Adam
0 Kudos
Message 3 of 3
(2,568 Views)