July 16, 200223 yr 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
July 16, 200223 yr 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.
July 18, 200223 yr 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
July 19, 200223 yr Author 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
July 26, 200223 yr 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]
August 13, 200223 yr Author 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
August 16, 200223 yr 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?
August 19, 200223 yr Author 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
September 3, 200223 yr 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
Create an account or sign in to comment