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

Can some one please help me.

I have a filemaker script which is used to scan documents into a folder.

I do not have any applescript skills and don't know how to pass FM script variables to applescript.

I have a variable $Scanpath which determines the path to the file and another $Filename which gives it a name

How can I pass these values to Applecript

My attempt which does not work is:

set theScannerSetup to "Scan SS 1 BW US Letter Page"

set pathToFolder to "$Scanpath"

set fileNameBase to "$Filename"

set fileNumber to 1

tell application "ScanTango"

-- Scan a document

scan with setup (scanner setup theScannerSetup)

-- Create the filename

set fullPath to pathToFolder & fileNameBase & fileNumber & ".pdf"

-- Create the path to the save file

set theSaveFile to fullPath

save front document in theSaveFile

close front document

end tell

Can some one tell me the right syntax

Joseph

You cannot refer to Filemaker variables inside AppleScript. You need to either define the variables in AppleScript, using references to Filemaker fields or switch to calculated AppleScript.

  • Author

Thank you

I have very little applescript skills so I don't know how to do this.

How can I tell applescript to grab a value from say gFilename?

How can I tell applescript to grab a value from say gFilename?

Try:

set fileName to cell "gFilename"

The field needs to be on the current layout.

  • Author

A thousand thank you's for your help

Joseph

I highly recommend using calculated Applescripts in FM. I have printing routines that have AppleScript calling bash routines that get complex , understanding that AppleScript evaluates text is an important concept to grasp, and calculated Applescripts, as much as they're a real pain to write (what with the necessity of enclosing text in the Quote function and other issues), work quite well once written properly.

RW

  • Author

Try:

set fileName to cell "gFilename"

The field needs to be on the current layout.

This didn't work

I got a syntax error

Joseph

I highly recommend using calculated Applescripts in FM. I have printing routines that have AppleScript calling bash routines that get complex , understanding that AppleScript evaluates text is an important concept to grasp, and calculated Applescripts, as much as they're a real pain to write (what with the necessity of enclosing text in the Quote function and other issues), work quite well once written properly.

RW

Unfortunately I have little if any applescript skills so this is beyond me

joseph

Try:

set fileName to cell "gFilename"

The field needs to be on the current layout.

No; that's one of the great things about applescript and globals.

They do NOT need to be on the current layout; or any layout.

You need to know the name of the field; and the name of the table occurrence.

The table occurrence does not need to have ANY layouts based on it.

If a valid table occurrence name is "Contacts" then

set fileName to cell "gFileName" of table "Contacts"

set fileName to cell "gFileName" of table "Contacts"

Thanks, that's very useful (and entirely undocumented, AFAIK).

I highly recommend using calculated Applescripts in FM.

I don't know of any advantages a calculated Applescript might have as such. I use it out of necessity, not by choice.

BTW, writing a calculated Applescript is easier if you do it in a text field, then use the Quote() function to "encode" it for you.

Another useful technique is to use a generic template and insert variables into it, e.g.

Let ( [

template = "display dialog \"message\"" ;

message = Get (CurrentDate)

] ;

Substitute ( template ; "message" ; message )

)

This didn't work

I got a syntax error

There's no possible answer to that.

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.