Using osascript to work around a Spaces bug in Leopard

I had started up Toast and dragged a video file to be burned to DVD.
This takes a long time, during which Toast is unresponsive (won’t hide or minimize).
I recently installed Leopard but hadn’t yet set up “Spaces”, which is Mac OS X’s version of virtual desktops.

I created a 2×1 setup and ctrl-right-arrow’ed to the “right” desktop to continue working without clutter.

After about 15 minutes, I was forcibly switched to the “left” desktop in mid-keystroke (this is something Mac OS X does that **really** bugs me — OS 9 never did it) when Toast had finished importing the video.
Since Toast was now responsive, I decided to move it to the right desktop and everything else back to the left one.
I don’t know why, it just felt better.

15 minutes later I decide I want my usual 3×2 virtual desktop setup, so I fire up Spaces and make it so.

Fast forward another ½ hour or so, and I realize that I really should burn that DVD.
I click on the Toast icon in the dock (which I belatedly notice is dimmed like a “hidden” app), and I’m zapped over to desktop 4 (first on the bottom row). But.. no Toast.

After about 5 minutes of attempting to get Toast to reappear I am ready to give up.
But then i realize I will have given up all that time Toast took to analyze/re-encode(?) the video, and it would be really, really good to save my work before quitting.
Unfortunately, Toast does not have a “Save As” contextual menu on its dock item.

So after a few unsuccessful tries, I finally type this in iTerm:

% osascript
tell application "Toast Titanium"
    close front document saving yes
end tell

This pops up a “Save As” dialog and I save my file, after which I have no compunction about choosing “Quit” from the Toast Dock icon contextual menu.
Day saved (well okay, 15 minutes), a little bit learned.

3 Responses to “Using osascript to work around a Spaces bug in Leopard”

  1. rae Says:

    Found out recently that a much simpler solution is to hit F8 to get into spaces, then type ‘c’, which “collects” all windows in all spaces into your current space.

  2. Music Says:

    yes that was a huge problem as its take a long and toast won’t hide or there was no other way except to wait and watch wit out doing anything.

  3. Datong Tour Says:

    Great post, what you said is really helpful to me. I can't agree with you anymore. I have been talking with my friend about, he though it is really interesting as well. Keep up with your good work, I would come back to you.

Leave a Reply