Applescript and VMWare Fusion help

Okay, I have this crazy idea. We are currently moving our office completely to Macs and the only lone holdout windows program we use is Worldship from UPS. We have it integrated with our accounting program Acctvantage so we hit a single keystroke, put in an order number and Worldship populates with the shipping information. We've put Worldship into a virtual machine with VMWare's fusion and that works great. The only problem is that we have to manually click on Worldship before we hit our keystroke since it is now virtualized in windows and everything else we're doing is on the Mac side.

I was hoping that there was someway to create an Applescript or Automator action that would do this:
When we hit our keystroke (say F5), it would trigger an automator action on the Mac side to bring Fusion to the focus and then send the f5 keystroke again. This would make it so whether we're in the Mac side or in Fusion the one keystroke would essentially do the same thing for the user. We have Fusion running in Unity mode so to the user Worldship appears completely like a Mac program, but if the focus is not on Worldship, our keystroke doesn't work. I'm just not versed in Applescript so I don't know if this is possible. It seems like it should be simply, but does anyone know if this is possible?
Thanks
Mark

MacBook 2 GHz, Mac OS X (10.4.9), 2GB ram

Posted on Feb 14, 2008 6:37 PM

Reply
4 replies

Feb 15, 2008 2:31 AM in response to Mark Bolick

You can attach an Applescript to a function key with a utility such as QuicKeys - http://www.startly.com/products/qkx.html .

What you want to do is pretty straightforward and can be accomplished with this script:

tell application "VMWare Fusion" to activate -- this will bring Fusion to the front
tell application "System Events" to key code 96 -- this is key F5

Copy and paste these lines into Script Editor and save as an application and attach to your key.

An alternative would be just to run the application from the Dock.

This assumes that you already have your application running in VMWare Fusion and that it's the frontmost application in Windows. Since you say that you are not using other applications in Windows this might be a safe assumption to make.

Note that I don't use Fusion and it is not scriptable, but the evaluation that I downloaded does respond to the activate command and the keystroke is relying on System Events.

Feb 15, 2008 8:21 AM in response to Mark Bolick

I found another program to do the key attachment: http://www.macupdate.com/info.php/id/14352/spark It seems to be free and uses fewer system resources.

I don't have any experience of this or QuicKeys, so I can't recommend one over the other (or at all). I don't know of any way to assign the script to a key without third-party software.

The keycode for F15 is 113.

Good luck!

Feb 15, 2008 4:53 PM in response to Mark Bolick

That's great. I downloaded the aforementioned program and it worked halfway. I could get the focus on VMWare with the hot key, but then it got stuck on the secondary key click and hung for a few minutes. I finally decided to make it a two keystroke process. One key (F14) activates the hot key to bring VMWare to the focus and then hitting F15 directly afterward operates as normal within the windows environment to bring up Worldship's entry box.
This worked great. No big deal hitting just one more key to accomplish it.
Thanks for all the help, this works great!
Much appreciated.
Mark

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript and VMWare Fusion help

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.