paul_apted Posted July 16, 2002 Posted July 16, 2002 hello, i have a DB in which each record is referenced to a sound file on a hard drive ,i can play the sound via quicktime using an applescript .What i would like to be able to do is COPY the soundfiles (that are referenced from the records in a found set) to another location. any ideas any one Paul Apted
Kurt Knippel Posted July 16, 2002 Posted July 16, 2002 While I do not know the exact commands, but Applescript can accomplish this. You could also use Troi File plugin to do file manipulation from within Filemaker without needing Applescript.
jfmcel Posted July 18, 2002 Posted July 18, 2002 Here is a sample script that will work if you are storing your sound files as file references... tell application "FileMaker Pro" set theFile to cell "container" of current record end tell if theFile is not "" then try set thePath to theFile as string on error display dialog "Container data is not stored as reference to file" return end try set theDestinationFolder to choose folder tell application "Finder" duplicate file thePath to theDestinationFolder end tell else display dialog "No file found in current container field" end if
paul_apted Posted July 19, 2002 Author Posted July 19, 2002 thanks for the script, however,when i run the script i get the following error: "Findergot an error:Can't set alias (my chosen destination) to file (my field with the text of the file path in this case "sfx:fx:hit:hit01:hit-01/34. (error -10006)... any ideas? thanks for your help Paul Apted ps i am running FM 5.5 on OSX 10.1.5 with the files on a firewire drive known as SFX
jfmcel Posted July 26, 2002 Posted July 26, 2002 I sorry I haven't been quick to reply. The script needed minor modification to work for OS X... tell application "FileMaker Pro" set theFile to cell "container" of current record end tell if theFile is not "" then try set thePath to theFile as string if thePath = "" then display dialog "No file found in current container field" return end if on error display dialog "Container data is not stored as reference to file" return end try set theDestinationFolder to choose folder set theAlias to alias thePath tell application "Finder" duplicate theAlias to theDestinationFolder with replacing end tell else display dialog "Could not copy file" end if [OS X does not appear to handle the error capture as well as OS 9]
paul_apted Posted August 13, 2002 Author Posted August 13, 2002 So it goes on... Thank you for the new script ,unfortunately now i get a -43 error (File sfx:fx:ct:ct 03:ct-03/28 wasn't found) i pasted your script as was just changing '"container field" to the field "filepathtext" which contains the filepath ,i am trying to think what else i could do to make it work but have no idea , thank you for your help anyway ,if you have any bright ideas... Paul Apted
jfmcel Posted August 16, 2002 Posted August 16, 2002 Explain to me your situation so I understand a bit more clearly. You have the file path in a text field or you have a container field?
paul_apted Posted August 19, 2002 Author Posted August 19, 2002 yes, each record has a text field called "Filetextpath" . i have a script that copy's this field into a global field and then plays the sound via quicktime. this works fine so i know the file path works , if there is any more info you need let me know thank you Paul Apted
jfmcel Posted September 3, 2002 Posted September 3, 2002 This is a simple problem and I have hopelessly complicated it. Try ... 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 else display dialog "Blank String" end if
Recommended Posts
This topic is 8118 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