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.

Published by


Mac developer

One thought on “Using osascript to work around a Spaces bug in Leopard”

  1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see

This site uses Akismet to reduce spam. Learn how your comment data is processed.