I am trying to write a script that will take subfolders from a selected folder and import their files using the subfolder name as the name of the project in Aperture. Under Mavericks
I think there is a problem in the line set pics to (every file of the folder aFolder where visible is true)
but I am not sure. Not sure how to correct this or what concept in apple scripting I am failing to understand.
Here is what I have so far:
set MainFolder to (choose folder with prompt “Choose Dive Trip Main Folder.”)
set AppleScript’s text item delimiters to “:”
tell application “Finder”
set theFolders to get every folder of MainFolder
repeat with aFolder in theFolders
set pics to (every file of the folder aFolder where visible is true) as list
set ProjectName to text item -2 of (aFolder as text)
tell application "Aperture"
activate
tell library 1
set theProject to make new project with properties {name:ProjectName}
end tell
with timeout of 600 seconds
import pics by referencing into theProject
end timeout
end tell
end repeat
end tell
set AppleScript’s text item delimiters to {“”}