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.

Pasting a variable from Applescript into a find request

Featured Replies

I have a scriptmaker script to enter find mode which my Applescript calls. I then want the applescript to set a field in the find request to a string variable held in my applescript at which point the applescript will call another two scriptmaker scripts that performs the find and deletes found records respectively.

I tried doing this all in applescript but I am not yet up to scratch on FM language keywords and syntax for applescript.

Where I am going wrong is in the following code when I try to set the "MACAddress" field. I keep getting an error saying "Can't get or set "MACAddress" to "VariableContents"

tell application "Finder"

activate

my GetMACAddressFromName(the_item)

move the_item to folder DPImportFolder

tell document FMLaunchFileName of application "FileMaker Pro"

activate

do script FileMaker script "Open ASP Desktop Printers Database"

set theRequests to the_item_MACAddress as string

tell document "ASP Desktop Printers" of application "FileMaker Pro"

activate

do script FileMaker script "Enter Find Mode"

set contents of field "MACAddress" of current record to theRequests

do script FileMaker script "Perform Find"

do script FileMaker script "Delete Found Records"

end tell

end tell

my DPImport(the_item)

end tell

To perform a find in FileMaker using AppleScript, I'm using someting like this :

tell application "FileMaker Pro"

delete every request

set newrequest to create request

set cell "Name" of newrequest to "Hoornaert"

find

end tell

You can create multiple requests

tell application "FileMaker Pro"

delete every request

set newrequest to create request

set cell "Name" of newrequest to "Hoornaert"

set newrequest to create request

set cell "First Name" of newrequest to "Rapha

Not sure if this will do it but here's the usual syntax:

tell application "FileMaker Pro"

activate

open file "SomeHardDrive:SomeFolder:SomeDB"

show (every record of database "SomeDB" whose cell "SomeField" = SomeVariable)

end tell

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.