Tag Archives: applescript

How to send F2, F8, F9, F12 to a VNC Remote PC from Mac OS X

When recently using Intel Active Management Technology (AMT) I was remotely connected via the RealVNC client, but was having trouble sending keystrokes like F2 to enter the BIOS, F12 to select a startup device, or F8 to access the Windows startup menu. This setup is complicated for a few reasons – first I’m using a Mac keyboard. Secondly, OS X remaps the function keys to do things like dashboard, expose, brightness, and volume by default. After a little searching and trial and error, I found that I can use the free utility included with Mac OS X – AppleScript Editor.app – to send keycodes to the VNC connection. Here’s the code for the applescript you can use to send the F12 key: tell application “VNC Viewer” activate tell application “System Events” to key code 111 end tell This is what it should look like in the editor: To send key combos, like holding down alt and pressing F4, the syntax would be something like this: tell application “System Events” to key code 118 using {command down} We use command instead of alt because that is how Real VNC Viewer translates the “alt” key for a remote windows system by default. To send other keyboard F-keys to the remote Windows machine, use the table below to find the appropriate key – make sure to reference the “Mac” column even if the remote machine is a Windows box. What about JAVA? But what happens if you are running a java applet for … Continue reading

Posted in Tech Tips | Tagged , , , | Leave a comment

Applescript: Check Application Is Running

Below is my Applescript example of how to check if an application is running, such as Finder.app, VLC.app, itunes.app, or something along those lines. Quite often I need to check if an application is running as part of my applescript, and so I use this little function / subroutine in applescript to test if the application is running: on appIsRunning(appName) tell application “System Events” to (name of processes) contains appName end appIsRunning Example usage: display dialog appIsRunning(“Finder”) The above apple script example will show “true” in a popup dialog.

Posted in Mac, Software, Tech Tips | Tagged , , , , , , , , | 1 Comment

Applescript: Unhide / Restore All Windows

Posted in Mac | Tagged , | 1 Comment

Applescript: How to Activate the File Menu

Posted in Tech Tips | Tagged , | Leave a comment