AE result


I recently posted a message trying to script Toast. That has been resloved. However, since i am generating the script for Toast out of Director, I need Apple Script to return a result of a successful burn back to Director. All I need is a 1 or a 0 to be returned. How do you make AppleScript return a result for Director (or any other program) to read?

Please help :cry:


It’s possible that a result is already being generated and it just needs to be captured. Something like this might work.

tell application "Toast"
set foo to do something
end tell

If a result exists, the variable ‘foo’ should contain it. It might not be the type of result that you want but maybe it will be useful nonetheless.

tell application “Toast”
set foo to do something
end tell

in this script the doing something, I assume, is doing what I have put into the original script ,Yes?

FYI, The original script is

tell application “Finder”
select file “mysound.aif” of folder “sounds” of folder “source” of folder “Karaoke Program” of startup disk
open selection
end tell

tell application “Toast Titanium”
with timeout of 30000 seconds
write current disc as session with ejecting and quitting without asking and verification
end timeout
end tell

I realise that this code is machine specific…

Thanks for the reply, I am a real novice at AppleScript.



I just looked at the dictionary for Toast on an old OS 9 machine and it doesn’t appear to return a result for the ‘write’ command. I don’t have any experience with scripting Toast so maybe someone else can offer a reliable way to confirm a burn. Sorry. :?

Rob, Thanks for the reply.

I have added a couple of lines of code to the script to re-activate the Director projector after ejecting the CD and this will do the job for me. However, if I could pick your brain just one more time :wink:

Is there any way to using Toast in OS9 to eliminate the prepare disc/burn or eject alert to pops up after putting in a blank disc and to eliminate the eject/burn/cancel alert that appears after my script has already ejected the disc…

The point is, I am developing a Karaoke program that, if all goes well, automatically burns the CD with no user interaction. So far the only actions the user has to take is to hit “prepare” on the first alert and “eject” on the second and unfortunately neither is the highlighted choice or i could add in a button to simulate the enter key in Director…


According to the dictionary, it might be possible. If so, this untested code might work. I’d make it the first line in the Toast script. Good luck! :slight_smile:

tell application "Toast"
set user interaction to not allowed
-- rest of Toast stuff here
end tell


So I placed that line about user intercation as the first liner in the Toast part of the script but still I get an alert.

Well, to be more specific:

This script only works if a blank CD is put in the drive before activating the script itself. If I wait until Toast requests that I “insert a recordable CD” and I push “cancel” or put in a disc then the script returns a Toast error.

When I added your line of code, Toast hung after ejecting the CD and I had to do a hard restart.

The problem is that, in Toast 5.2, immediately you put a blank disc in the tray, it asks whether you want to burn, eject or prepare it even before the script is run.

I’m now wondering whether you can change the highlighted text on those alert messages. Presently, the default is BURN on the first one and I could do a workaround if PREPARE was the highlighted one. Will Res Edit do that kind of thing? I know I’m probably clutching at straws but…

Rob, sorry.

The deal is that your line doesn’t make any difference. I think the reason is that these alerts are not being generated by Toast but by the system itself.

It’s due to the fact that when I put in a blank disc, the system wants to know what to do with it, before and after the script has run. If I could somehow just set up the system to mount the disc icon without asking what it should do with it then I’m set, because then the second alert would not even be generated. The second alert is because there is a disc ICON on the desktop even after the disc itself has been ejected…

It’s like some sort of unresolved alias issue I think,

It might be possible to hack it with ResEdit but that’s outside of my pea-sized knowledgebase. :wink:


Thanks for the help.

As it stands, I can assign a button in Director to represent the Enter key and click the Toast button in that first dialog box instead of Prepare. If I can get Toast to run in Server Mode i.e. in the background the job is done, because clicking on the Toast button instead of prepare eliminates the need for the second dialog box since the ‘Toasting’ resolves the desktop alias.

If you care what is a line of code for running Toast in the background?

Is it?

open in server mode

Thanks so much for the trouble, It’s comforting to know that MacScripter is out there even just as a sounding board…

I’ve never tried it (didn’t even know it was possible!) but it looks like it should be:

set server mode to true

Good luck! :slight_smile:

It’s all good :smiley:

Thank you Thank You

Apple really does rock :twisted:

This has all generated a massive interest in AppleScript in general for me, I’m so stoked that a newbie could come into scripting with a specific project in mind and pull it off (with help) in two days.


this script seems to generate very large rescued items in the trash.

I’m not bothered about it particularly but I wonder can you run an automatically generated script that emptied the trash every day again without any user interaction?

I will be working on it but any help… :rolleyes:

I’m trying to script Toast 5.2 to burn a CD without any user interactions (no pop ups form Toast). I realize this may have already been addressed in a previous thread but I cannot get my script to work correctly.

The following script works unitl it gets to the record option when Toast asks if the disc should be burned as a disc or a session. I want to bypass this and always burn the disk automatically as a disc.

Any suggestions?

tell application “Toast Titanium 5.2”

	open file "YU [Work]:CD's:57214-Facilities CD"
	close tray
	write current disc as disc with ejecting

end tell

Pedro Paramo