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.

Insert Pictures in FM with AppleScript

Featured Replies

  • Newbies

Hi everybody,

I wanna insert pictures in FM database via AppleScript, but not the reference of the file. I know the database is going to be heavy, but I really need having the picture in the database and not its reference.

I made an AppleScript (see code below), but it only store the reference of the picture. What can I do and how can I modify my AppleScript to insert the picture and not its reference.

Thanks for your help

Jave

Code of my AppleScript

tell application "Finder"

set finalFolder to "Macintosh:Utilisateurs:jave:Bureau:Images"

repeat with x from 1 to (count of every item of folder finalFolder)

set mapPart to item x of folder finalFolder

set partName to name of mapPart

tell application "FileMaker Pro"

activate

tell document 1

set currentRecord to create new record

tell currentRecord

set cell "Image" to file (mapPart as string)

set cell "NomFichier" to partName

set cell "Ville" to "Basel"

end tell

end tell

end tell

end repeat

end tell

When I recently wrote an AppleScript to import a folder of images, I handled it differently.

AppleScript looped through each file in the folder. For each one, it made a copy in a known location and called it image.jpg. FileMaker then used the Insert Picture command to import image.jpg into the correct field. The next time through the loop, image.jpg held the next file in the folder.

Chuck

There are others ways to do this but I recommend using the giconvert command from the GraphicsImporter scripting addition. You can get the scripting addition at http://osaxen.com/graphicsimporter.html

After you download the addition, place it in the scripting additions folder in the system folder. The syntax is something like...

set theImageData to giconvert theImageAlias

tell app "FileMaker Pro" to set cell "Image" to theImageDate

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.