VMware Communities
reesd27
Enthusiast
Enthusiast

request: support for user interface scripting (universal access)

It would be very helpful if vmware fusion supported at least basic scripting using applescript. At the very least user interface scripting for window control, which would allow various tools to control the window locations and sizes. See this link for background: http://www.mactech.com/articles/mactech/Vol.21/21.06/UserInterfaceScripting/index.html

Thanks,

d

0 Kudos
5 Replies
WoodyZ
Immortal
Immortal

FWIW While AppleScript is not supported by Fusion nonetheless you can do some scripting however it will not be as robust as if it were natively supported. Also with Fusion 2.0 you can use "/Library/Application Support/VMware Fusion/vmrun" to do some bash scripting with or incorporate it into AppleScript or Automator Actions.

Although not need in Fusion 2.0 these were written for 1.x so as an example have a look at Re: how to automate the \"snapshot\" feature?? and

Also have a look at and as some examples.

Although I do have to say it's truly unconscionable to write a major application for OS X and not have built in support for AppleScript and frankly it's absurd that VMware did not add AppleScript Support to Fusion.

Message was edited by: WoodyZ

0 Kudos
Pat_Lee
Virtuoso
Virtuoso

It would be very helpful if vmware fusion supported at least basic scripting using applescript. At the very least user interface scripting for window control, which would allow various tools to control the window locations and sizes. See this link for background: http://www.mactech.com/articles/mactech/Vol.21/21.06/UserInterfaceScripting/index.html

What SPECIFIC problems/solutions are you trying to solve with AppleScript?

As Woody mentioned, we have command line scripting with vmrun that enables you to power off and on VMs, take snapshots, revert to snapshots, and more. Eric has wrapped that into an Automator Action as well.

People have used UI scripting in the past to do some AppleScript functionality.

So, what specifically are you trying to do with AppleScript? That will help us understand how we need to solve the problem in future releases.

Thanks,

Pat

0 Kudos
reesd27
Enthusiast
Enthusiast

What SPECIFIC problems/solutions are you trying to solve with AppleScript?

As I mentioned in my original post, "user interface scripting for window control, which would allow various tools to control the window locations and sizes". To be more specific, I would like programs like zooom, and Mercury Mover to work. Or windows resizing scripts like http://www.macosxhints.com/article.php?story=20050428173653581 to work. So essentially the ability to get and set the bounds.

Thanks,

d

0 Kudos
mudaltsov
Expert
Expert

I tried following the User Interface Scripting article you posted:

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

And I was able to control the position and size of the window using AppleScript. So I think most of the standard UI Scripting that OS X allows should work with Fusion just fine. It may be difficult to do with Unity windows though, since the guest app windows are controlled by the guest, not the host.

Here's an example script that I used in Script Editor after checking "Enable access for assistive devices" in System Preferences -> Universal Access:

tell application "System Events"

   tell process "VMware Fusion"

      set size of window 1 to {950, 750}

      set position of window 1 to {260, 40}

   end tell

end tell

Of course, you have to get and use the proper window id, and if you want to actually match a certain guest resolution, you have to add the proper toolbar and status bar dimensions.

0 Kudos
reesd27
Enthusiast
Enthusiast

I tried following the User Interface Scripting article you posted:

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

And I was able to control the position and size of the window using AppleScript. So I think most of the standard UI Scripting that OS X allows should work with Fusion just fine. It may be difficult to do with Unity windows though, since the guest app windows are controlled by the guest, not the host.

Yes, that is a good clarification. It is Unity windows I want to control. Fusion would need to receive the position/size updates and then pass them on to the guest.

Thanks,

d

0 Kudos