Un-minimize a window from Dock?

Is there a way in AppleScript, regardless of the application, to “open” or “unminimize” a a specific window on the Dock by it’s title?

If it needs to be specific to an application, this is Parallels for Mac v5.

THANKS! :slight_smile:

Probably no real help but in Finder it’s the collapsed value of a Finder window. Does Parallels have a Dictionary?

No, no dictionary.Parallels is dumb a as a post in AppleScript terms. :stuck_out_tongue:

I got around this problem in Parallels 4 by having AppleScript open the Virtual Machine file. If it was already open but collapsed, it would pop-out of the dock (expand). Didn’t work 100% of the time, but often enough to be useful (maybe 90%?).

What I am doing: I run 6 separate virtual machines for web site quality assurance and have to switch back-n-forth. I collpase the current VM before moving to the next one so I can keep them straight (and keep the video memory and audio from spazzing). I use an X-Keys button panel and each button keyed to an script that toggles that VM. Saves me a ton of keystrokes and mouse movement per day (think: less RSI).

For whatever reason, Parallels 5 doesn’t work with my old “trick”: “opening” a VM that is already open but collapsed brings Parallels to the front, but leaves the VM collapsed.

:confused:

GUI scripting works of course

tell application "System Events" to tell process "Dock" to tell list 1 to get name of every UI element

choose from list result
result as string
tell application "System Events" to tell process "Dock" to tell list 1 to click UI element result

Now you’ll just have to get the titles of Parallels’ windows. Perhaps this can be done also with System Events?

Hope it helps,
ief2

THANKS!

So two more questions:

#1.I got simply this to work based on your supplied info:

tell application "System Events" to tell process "Dock" to tell list 1 to click UI element "Firefox_100406"

I’m a little confused by the function of “list 1”. Where did you get that from? How did you know it was “1” and not “2”? Is it always “1”?

I don’t seem to need the first line you gave (the “tell list 1 to get”).was that only necessary to drive the picklist you had in yours?

#2.is there any way (UI or otherwise) to do the reverse”collapse a window by name? For example, I’m in Parallels and I want to collapse the window “Firefox_100406”.

Thanks again!

I used Prefab UI Browser and looked at the process named “Dock”. UI Browser said the process has a only 1 list (list 1) and that list contains several UI Elements.

Keystroke Command-M maybe? I googled a little and I didn’t find anything useful apart from Command-M.

tell application "System Events" to tell process "Parallels" to keystroke "m" using command down

Hope it helps,
ief2

Fair enough.I hadn’t considered that UI Browser would work on the Dock, duh.

Unfortunately Parallels doesn’t respond to that either, despite having the yellow button to do it manually. grumble

I may have to see if there is a hidden way to manage it. I wasn’t able to do that before, so it’s not a huge deal, but would be nice if I could while I’m tinkering anyway.

ief2, you’ve been a great help, thanks!

Per ief2’s example, I dusted-off Prefab UI Browser, and found the minimize button, and to be safe, referenced it by index:

tell application "System Events"
	tell process "Parallels Desktop"
		click button 3 of window "Firefox_100406 - Parallels Desktop"
	end tell
end tell

I’m assuming the Dock sees the “document name” while Parallels sees a “window name” (where it adds " - Parallels Desktop")?

I also forgot to mention I run my VMs in Window mode, not Coherence, which helps with the scripting.

Wanted to thank again. I just finished using the “Expand Window” and “Collapse Window” scripts, combined with ControllerMate and my X-Keys Button Panel to create a single button for each browser scenario I need to QA web sites again (2 Mac and 6 in Parallels). The button will either launch the browser (Mac) or VM (if it’s not open), or toggle the browser/VM’s collapsed/expand state (if the VM is open).

The addition of the “collapse” to the button is going to help alot!

Here’s some screenies of the ControllerMate logic:

Sample Mac browser toggle
Sample Parallels VM toggle

:smiley:

That looks very complicated to me, but I’m glad I could help.

Complicated maybe, but pretty cool.one button that does one of three things depending on context. Might have been able to do it all with one larger AppleScript, but having ControllerMate manage some of the if-then logic was more flexible and expedient. :cool: