Jump to content

Copying files thru Filemaker


This topic is 7930 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 smile.gif"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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

This topic is 7930 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.