AE result

Hello,

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:

BK
Mediablitz

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
foo

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
foo

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ā€
activate
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ā€
activate
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.

BK

Yes.

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ā€¦

BK

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

Rob,

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:

Rob,

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.

Cheers

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ā€

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

end tell

Pedro Paramo