Using Applescript, I’m trying to spot an audio file to the playhead of the open multitrack document. This is a small piece of a larger script.
I’ve tried doing it in Soundtrack Pro then saving as an Applescript, but for some reason the option is grayed out. I’ve also tried countless ways with terms from the Applescript dictionary. Although I’ve struggled for hours, it’s probably very simple. I’m wondering, what is the script for this?
Script so far:
tell application "Soundtrack Pro"
activate
tell track {name:"Track 1"} of multitrack document {name:"Untitled"}
spot file "MacintoshHD:Users:dk:Desktop:___Current Assets:Untitled Recording 247.wav"
end tell
end tell
This compiles but upon running returns the error: “Can’t get file “MacintoshHD:Users:dk:Desktop:___Current Assets:Untitled Recording 247.wav” of track {name:“Track 1”} of multitrack document {name:“Untitled”}.” .
Another iteration I’ve tried is removing the word “file” after “spot.” So the script is:
tell application "Soundtrack Pro"
activate
tell track "Track 1" of multitrack document "Untitled"
spot "MacintoshHD:Users:dk:Desktop:___Current Assets:Untitled Recording 247.wav"
end tell
end tell
This is good because no error message is shown. It also, however, doesn’t seem to do anything more than activate soundtrack pro - no file is added to the track.
the manual of SoundTrack Pro says that you can spot only clips which are already added to the document
In AppleScript dictionary an document has file elements which you can refer to
Now, to add files to the document… I guess I’m not exactly sure what that means. Manually, I can use the “Browser” tab to find the file on the computer and spot it from there. I guess this is a different method though?
How might I add a file/sound clip to the Soundtrack Pro document with an Applescript? I already have a loop set up that selects each sound clip and its info subsequently in a folder, so it’s just a matter of getting those sound clips into Soundtrack pro.
Sorry for my ignorance - yes I suck at ST Pro and Applescript.