Jump to content

Pasting a variable from Applescript into a find request


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

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 8238 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.