Cant open a file with Applescript

Sep 14, 2023
Reaction score
--This does not open the ".cpr" file
tell application "Finder"

--copy foler
set x to "Macintosh HD:Users:shawnbrady:Dropbox:Audio:Features:"
copy folder "Macintosh HD:Users:shawnbrady:Desktop:Features:" to folder x
delay 1

--rename folder and file
set y to every item of window 1 whose name contains "omf"
set omf_name to name of item 1 in y as string
set file_name to characters 1 thru -5 of omf_name as string
set folder_name to characters 1 thru -3 of file_name as string
set name of file "Macintosh HD:Users:shawnbrady:Dropbox:Audio:Features:Features:FEAT.cpr" to file_name & ".cpr"
set name of folder "Macintosh HD:Users:shawnbrady:Dropbox:Audio:Features:Features" to folder_name & "NPR"
delay 1

-- open file DOES NOT WORK
set xx to every folder of window 1 as string
set yy to (every item of folder xx whose name contains ".cpr") as string
delay 1
open file yy

end tell

Cory Cooper

May 19, 2004
Reaction score
Hello and welcome.

I am not very experienced with AppleScript/Automator.

It looks like you are working with some audio files - .omf and .cpr. Do the files open in the proper DAW without using the script? Are you try to convert them?


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question