Copying files into Toast

I’ve been running the following scripts for about four years and did not have any problem until upgrading to Mavericks.

I do have one MacBook Pro running with Mountain Lion and there are no issues. The script is working fine.

CONTEXT
I’ve created an applescript program to feed the Toast application with files to be burned. I have two instances of Toast (T1 and T2) opened at the same time. When burning a DVD only one of the two is running. I’ve automated this process to avoid burning the wrong files.

I am now trying to compile the script and I do now get an error. Would someone have an idea of why I now have those issues.

With regards1

Daniel

--set FMPrec to cell "GraverDVD_the_list" of current record
set FMPrec to "0201 3432"

set videoFolder to "Data:VideoFolder:"
set ToastPath to (path to applications folder as text) & "T1.app"

set stringLength to length of FMPrec
tell application ToastPath to activate
   with timeout of 0 seconds
       set toast_project to current disc
           repeat with i from 1 to stringLength by 4
                  if stringLength - i < 4 then
                     set nextpar to (text i thru -1 of FMPrec)
                  else
                     set nextpar to (text i thru (i + 3) of FMPrec)
                  end if
           set theFolder to (text 1 thru 2 of nextpar)
           set files_to_add to videoFolder & theFolder & ":" & "IMG0" & nextpar & ".mov" as string
           add to toast_project items {files_to_add as alias}
           delay 1.5
       end repeat
   end timeout
end tell

Model: MacMini - OS X (10.9.4)
AppleScript: 2.6.1
Browser: Safari 9537.78.2
Operating System: Mac OS X (10.8)

Hi,

to resolve application terminology the parameter after application must be a literal string,
otherwise you have to wrap the code in an using terms from block


set FMPrec to "0201 3432"

set videoFolder to "Data:VideoFolder:"
set ToastPath to (path to applications folder as text) & "T1.app"

set stringLength to length of FMPrec
using terms from application "Toast Titanium"
	tell application ToastPath to activate
	with timeout of 0 seconds
		set toast_project to current disc
		repeat with i from 1 to stringLength by 4
			if stringLength - i < 4 then
				set nextpar to (text i thru -1 of FMPrec)
			else
				set nextpar to (text i thru (i + 3) of FMPrec)
			end if
			set theFolder to (text 1 thru 2 of nextpar)
			set files_to_add to videoFolder & theFolder & ":" & "IMG0" & nextpar & ".mov" as string
			add to toast_project items {files_to_add as alias}
			delay 1.5
		end repeat
	end timeout
end using terms from


Thanks Stefan,

I am moving forward, the script is now compiling.

At the statement “set toast_project to current disc” I now get an error “Can’t get current disc.” number -1728 from «class cddc». I’ve looked under the applescript open dictionary and I see “disc”. Is current disc still the right term?

with regards!
Daniel

set FMPrec to "0201332"

set videoFolder to "Data:VideoFolder:"
set ToastPath to (path to applications folder as text) & "T1.app"

set stringLength to length of FMPrec
using terms from application "T2"
	tell application ToastPath to activate
	with timeout of 0 seconds
		set toast_project to current disc
		repeat with i from 1 to stringLength by 4
			if stringLength - i < 4 then
				set nextpar to (text i thru -1 of FMPrec)
			else
				set nextpar to (text i thru (i + 3) of FMPrec)
			end if
			set theFolder to (text 1 thru 2 of nextpar)
			set files_to_add to videoFolder & theFolder & ":" & "IMG0" & nextpar & ".mov" as string
			add to toast_project items {files_to_add as alias}
			delay 1.5
		end repeat
	end timeout
end using terms from

tell me to activate

I’ve been trying different ways to code and I have been looking more closely at the Toast dictionary under Applescript and found the following :

application‚n [see also Standard Suite] : A Macintosh application
elements
contains discs.
properties
current disc (specifier, r/o) : the current disc

Current disc seems to be the right syntax. Why am I getting an error ?

I also found the following:

Video disc‚n [inh. disc] : a Video CD, Super Video CD or DVD-Video

elements
contains video tracks.
properties
name (text) : name of the disc volume (Disc Title). Depending on the application, you may want or need to keep this short and ASCII.
disc format (VCD/ŒSVCD/ŒDVD/ŒDivX) : what type of disc to write
create menu (boolean) : create a menu for the disc
menu title (text) : the title which appears in the disc’s menu. This does not suffer from the same restrictions as the disc’s name.
menu style (text) : the style of the disc’s menu. If a style of this name cannot be found, Toast will use its default menu style.

I’ve ran the script with having T1 and T2 closed. Running the script and replace T1 by T2 the script opened the right application. Does it mean I would need to close T1 or T2 each time I run this script ? Usually I have it always opened ? If it’s the case I need to ensure all parameters are set accordingly without any human intervention. I’ve included in this version a syntax for setting the name, the video title and the menu style.

However, is this the right syntax ?

[applescriptset FMPrec to “02013432”

set videoFolder to “Data:VideoFolder:”
set ToastPath to (path to applications folder as text) & “T1.app”

set stringLength to length of FMPrec
using terms from application “T1”
tell application ToastPath to activate
with timeout of 0 seconds
set toast_project to current disc
set name of Video disc to “monDVD”
set menu title of Video disc to “abcdef”
set menu style of Video disc to “Warp”
repeat with i from 1 to stringLength by 4
if stringLength - i < 4 then
set nextpar to (text i thru -1 of FMPrec)
else
set nextpar to (text i thru (i + 3) of FMPrec)
end if
set theFolder to (text 1 thru 2 of nextpar)
set files_to_add to videoFolder & theFolder & “:” & “IMG0” & nextpar & “.mov” as string
add to toast_project items {files_to_add as alias}
delay 1.5
end repeat
end timeout
end using terms from

tell me to activate]




MANY THANKS!
Daniel

When compiling my script the statement

automatically changed to

Is this a normal or an expected behaviour ?

Could that be the cause of my current disc error problem?

Thanks!
Daniel

I would like to pass the name of the Video, the title and the style to Toast Titanium.

I’ve tried with this syntax and I get the AppleScript Error “Can’t get name of Video disc”. Would someone know why I am getting this message. The term name, menu title menu style and Video disc came from dictionary.

With regards!
Daniel

set FMPrec to "0102"

set videoFolder to "Data:VIDEOfolder:"
set monDVD to "myDVD"
set menuTitle to "abcdef"
set menuStyle to "Warp"

set stringLength to length of FMPrec
tell application "Toast Titanium"
	with timeout of 0 seconds
		set toast_project to current disc
		set monDVD to (name of Video disc)
		set menuTitle to (menu title of Video disc)
		set menuStyle to (menu style of Video disc)
		repeat with i from 1 to stringLength by 4
			if stringLength - i < 4 then
				set nextpar to (text i thru -1 of FMPrec)
			else
				set nextpar to (text i thru (i + 3) of FMPrec)
			end if
			set theFolder to (text 1 thru 2 of nextpar)
			set files_to_add to videoFolder & theFolder & ":" & "M2U0" & nextpar & ".MPG" as string
			add to toast_project items {files_to_add as alias}
			delay 1.5
		end repeat
	end timeout
end tell

tell me to activate