Applescript and Filemaker

Discussion created by bigtom on Mar 29, 2014
Latest reply on Mar 30, 2014 by bigtom

I need a script that exports container images and then loads those images into iPhoto with a set album name and deleting the temporary image export files.

The export works fine. Setting the album name in iPhoto works fine. The import into iPhoto is not working. Get one image in and then the errors.


I am giving this calculated applescript a try but I am getting errors.

"Can’t make «class docf» "999999-10.jpg" of «class cfol» "image" of «class cfol» "Desktop" of «class cfol» "user" of «class cfol» "Users" of «class sdsk» of application "Finder" into type alias."

"Unknown Error: -1700."


Honestly there is nothing good I could find about the proper syntax for calculated applescripts in Filemaker. If someone can recommend a refference I would be happy to check it out.


I pieced this together from bits of info I found on the web. I guess I could try not using a calculated script. I do not know too much about applescript itself so that does not help. Same thing happens not importing as alias.




"set theFolder to " & Quote ( $path );

"set albumName to " & Quote ( $SKU );

"tell application " & Quote ( "Finder" ) & " to set theFiles to files of folder theFolder";

"tell application " & Quote ( "iPhoto" ) & " to if not (exists album albumName) then new album name albumName";

"repeat with oneFile in theFiles";

"tell application " & Quote ( "iPhoto" );

"import from (oneFile as alias) to album albumName";

"repeat while importing";

"delay 1";

"end repeat";

"end tell";

"tell application " & Quote ( "Finder" );

"delete files of folder theFolder";

"end tell";





Any info on how this works would be appreciated.