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?
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.
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. :?
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 ā¦
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ā¦
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ā¦
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,
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ā¦
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ā
activate
open file "YU [Work]:CD's:57214-Facilities CD"
close tray
write current disc as disc with ejecting