Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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

  • Author

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

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 

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.