I am writing an Apple Script that will eventually tag ads for all iTunes exports from EyeTV. But I ran into a simple problem with AppleScript paths that EyeTV returns as recording locations. Here's the context:
set recordingID to 370404006
set myid to recordingID as integer
tell application "EyeTV"
set eyetvr_file to get the location of recording id myid as alias
end tell
return eyetvr_file
alias "Macintosh HD2: Documents: EyeTV Archive: South Park.eyetv: 000000001613eaa6.eyetvr"
Now I need to extract the contained path and file prefix 000000001613eaa6 (using this question ) so that I can search for the corresponding commercial markings in the file 000000001613eaa6.edl, Here is the hiccup:
tell application "Finder"
set eyetv_path to container of eyetvr_file
set root_name to name of eyetvr_file
set fext to name extension of eyetvr_file
end tell
Results:
eyetv_path: document file "South Park.eyetv" of the folder "EyeTV Archive" of the folder "Documents" of the disk "Macintosh HD2" of the application "Finder"
root_name: "000000001613eaa6.eyetvr"
fext: ""
fext ".eyetvr", . ".eetvr" eyetvr_file root_name?
set fext to name extension of (eyetvr_file as document)
, ,
" " Macintosh HD2: : EyeTV: South Park.eyetv: 000000001613eaa6.eyetvr\ " ." -1700 "Macintosh HD2: : EyeTV: South Park.eyetv: 000000001613eaa6.eyetvr"