Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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]

  • 3 weeks later...
Posted

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

Posted

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

  • 3 weeks later...
Posted

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

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 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.