Scripting Toast - not quitting after burn - any idea's why?

(Newbie)

Happy new year to all!

I’ve been trying to script Toast 10 Titanium to do a burn and then quit afterwards. I’ve been through the Applescript dictionary for Toast and as a result, have come up with the following script:

tell application "Toast Titanium"
	open theFile
	set toast_project to current disc
	add to toast_project items files_to_add
	delay 10
	write toast_project with asynchronous completion, ejecting and quitting without asking
end tell

There’s a number of issue’s here, all relating to the write toast (line 6) part of the script - in fact none of it seems to work!

I can indeed get Toast to Eject the disk, but only if I set it to do so in Toast’s own pref settings - however, I’m still stuck when it comes to getting Toast to quit after it’s ejected the disc.

The next part of my script doesn’t work until Toast has quit!
Any help or advice please guys?

Thanks.

(Newbie)

After an evening of trying a few things, I found a get-around while looking through some scripts I’ve previously used.

I doubt it’s the correct way to do it, but it does seem to work:

set Disc_inserted to list disks
set disc_check to do shell script "drutil discinfo"

if disc_check contains "discType" then quit application "Toast Titanium"

Strangely though, I tried using this same idea to announce a sound prior to the app quitting, and it doesn’t seem to work.
I tried this in new script on its own (shown below) and seems to work just fine, putting it into my main script directly before the quit script above - it fails to sound!

set Disc_inserted to list disks
set disc_check to do shell script "drutil discinfo"

if disc_check contains "discType" then do shell script "afplay '/System/Library/Sounds/Twirly.aif'"

Baffled by this I must admit.

I look forward to comments and further suggestions when anyone has time to respond.

Thanks