paul_apted Posted January 29, 2003 Posted January 29, 2003 hello, i have a script that copies a soundfile that is referenced to a record in my database. tell application "FileMaker Pro" set thePath to cell "filepathtext" of current record end tell if thePath is not "" then set theDestinationFolder to choose folder try set thealias to alias thePath tell application "Finder" duplicate thealias to theDestinationFolder with replacing end tell on error errMes display dialog "Could not copy file" & return & errMes end try end if I can run this script and it works fine when copying 1 sound file ,how do i edit the script to copy all the soundfiles in the current found set to one destination folder ignoring any errors (records that are not linked) Thank you Paul Apted
jfmcel Posted January 29, 2003 Posted January 29, 2003 just create a looping script in ScriptMaker that looks like the following Go to Record/Request/Page[First] Loop Perform AppleScript[--your AppleScript goes here--] Go to Record/Request/Page[Exit after last, Next] End Loop
paul_apted Posted January 29, 2003 Author Posted January 29, 2003 that works if you don't mind selecting the destination folder for every record ,which get's old very quickly .. Any other ideas? Thanx Paul
BobWeaver Posted January 30, 2003 Posted January 30, 2003 Break your applescript into two parts. The first part would perform the "choose folder" part and then set a global to that folder path. That part would be done before you enter the loop. Then the second part would be the remainder of the applescript that copies the file, and would reference the global value to get the destination folder. --part 1, before the loop set theDestinationFolder to choose folder tell application "FileMaker Pro" set cell "destinationFolder" of current record to theDestinationFolder end tell --part 2, inside the loop tell application "FileMaker Pro" set thePath to cell "filepathtext" of current record set theDestinationFolder to cell "destinationFolder" of current record end tell if thePath is not "" then try set thealias to alias thePath tell application "Finder" duplicate thealias to theDestinationFolder with replacing end tell on error errMes display dialog "Could not copy file" & return & errMes end try end if *Filemaker Script Go to Record/Request/Page[First] Perform AppleScript[--your AppleScript Part 1 goes here--] Loop Perform AppleScript[--your AppleScript Part 2 goes here--] Go to Record/Request/Page[Exit after last, Next] End Loop
paul_apted Posted January 31, 2003 Author Posted January 31, 2003 Thank you very much for your input . the script worked after i changed the following line: set cell "destinationfolder" of current record to theDestinationFolder to set cell "destinationfolder" of current record to theDestinationFolder as string thanks for the help Paul
Recommended Posts
This topic is 7965 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now