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.

Copying image files

Featured Replies

  • Newbies

Hi - I'm sorry if this has been asked before. I'm new to this forum, FMP, and AppleScript. Here is my situation:

I have thousands of High Resolution Tiff files I need to send to many different agencies. The file structures were created years before we contracted these other agencies and are spread throughout many different folders. I can get a found set of the images I need to send to each agency, I just need a way to copy the original Tiffs to a new external HD. All of the Tiffs have a low Resolution JPEG I have referenced to a FMP 6 DB. I also have a path to the Tiff file in that DB. I can only assume the only way to do this is through scripting. Any thoughts are very appreciated.

Thanks,

Ed

It sounds as if you have pretty much what you need to automate this. You have the complete file path to the original file and the same of the destination folder (where the new file is going to be in). To see how it works, try this, which has you choose the file and folder. In your real script you'd put the file and folder path's instead.

tell application "Finder"

set theFile to choose file

set newFolder to choose folder

duplicate theFile to newFolder

-- or "move", same thing between 2 volumes

end tell

To see what each should look like, a Mac path, just use the command "(choose file) as string" and look at the result.

"Macintosh HD:Users:fej:Desktop:SDMUG DB:SDMUG_db.fp7"

(choose folder) as string -- ends in ":"

This is partition 1 of my external hard drive (dull name, I know):

"Part 1:Users:fej:Documents:"

If you had the original file path, and the path to the new folder, in FileMaker fields, the AppleScript would look like:

tell application "FileMaker Developer" -- comment out or remove in FileMaker

tell current record of window 1

set myFolder to cell "FilePath"

set newFolder to cell "NewFolder"

end tell

end tell -- comment out or remove also

tell application "Finder"

duplicate file theFile to alias newFolder

end tell

You don't need to: tell "FileMaker Pro" inside a Perform AppleScript step (the FileMaker app knows who it is, and it avoids the "Pro" or "Developer" name problem). So you can either comment those lines out, with a "--" preface, or remove them. They are only needed in Script Editor (who otherwise does not know who FileMaker is). I write the code in Script Editor (or Smile), with its pretty colors :-), then comment them out and copy/paste into FileMaker.

You'd want to be on a layout that had those 2 fields on it, for simplicity. Also easiest to just run this Perform AppleScript step for each record, inside a FileMaker Loop, with Go To Record/Request [Exit after Last, Next].

It would be possible to create the folder structure in the external drive, mirroring the original (not easy, but doable, I think), or rename the file afterwards (pretty easy).

  • Author
  • Newbies

Fenton - Thank You! With a little modification the second script works perfectly.

Ed

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.