AnsweredAssumed Answered

AppleScript Editor and FMP

Question asked by apw on Jun 27, 2010
Latest reply on Jun 28, 2010 by apw

Title

AppleScript Editor and FMP

Post

I developed a script in the AppleScript Editor, which I included in FMP as a "Perform Applescript". It works fine in the Editor.

=========================

setsong_fileto "Macintosh HD:Users:my_name:desktop:afplay_playlist.tab"

 

set the_Songs to paragraphs of (read file song_file)

 

set volume output volume 20

 

repeatwitha_Songinthe_Songs

 

seta_Songtoa_Song's contents

if (counta_Song's words) > 0 then

do shell script ("afplay " & quoted formofPOSIX pathofa_Song)

else

exitrepeat

endif

 

endrepeat

=================
Then I encountered two problems.
FMP doesn't accept the second line; it objects to "file" (expected ",", but found class name) and, after removing "file", to "song_file" (expected ",", but found identifier).
I simply don't understand this. It accepts "(read, file song_file), but then the object can't be found.
Furthermore, if I change the temporary file on the desktop to another location, the file is not found, although the path is correct and the file definitely present.
Any ideas?

Outcomes