Jump to content
Server Maintenance This Week. ×

How to FileMaker Pro Advanced Calculated Applescript ?


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

Recommended Posts

How do I get a value from FileMaker Pro Advance 17 variable as ( $$NAME ) into an Applescript that looks like;

tell application "Leitz Icon Software"
    -- Store path to this script folder.

    set pathToScriptFolder to POSIX path of ((path to me as rich text) & "::")
    -- Open blank label.
    open label pathToScriptFolder & "LabelWithAddress.LeitzLbl"
    
    -- Delete all objects to make sure the label is blank.
    delete label objects
    
    -- Create new address object.
    make new address object with properties {x position:0.3, y position:0.3, width:8.2, height:3}
    
    -- Change address object properties.
    tell first address object
        -- Setting content.
        set content to $$NAME
        
        -- Setting content alignment
        set horizontal alignment to Center
        set vertical alignment to Bottom
        
        -- Set the object scaling to auto fit.
        set scaling mode to AutoFit
    end tell
    
    save label in pathToScriptFolder & "LabelWithAddress.LeitzLbl"
end tell

Link to comment
Share on other sites

2 hours ago, Lee Smith said:

Did this work in an older version of FileMaker.

Too bad that didn't work. I'm not knowledgeable in AS, so someone else will need to jump in.

Lee

Link to comment
Share on other sites

What do you mean get it "into an AppleScript"? Does the script get invoked outside of FileMaker (which is what Lee's suggestion is for)? Or does it start from a FileMaker script?

Link to comment
Share on other sites

7 hours ago, LarsM said:

How do I get a value from FileMaker Pro Advance 17 variable as ( $$NAME ) into an Applescript

You need to select the Calculated AppleScript option and construct a calculation formula that returns the desired script as text, with the variable's value inserted into it - for example: 

"set content to " & Quote ( $$NAME )

Alternatively, place the value in a field and have your (native) AppleScript read it from there.

Edited by comment
Link to comment
Share on other sites

Help can anybody help a novice to tell how I should write an FileMaker Pro Advanced Calculated Applescript if I have an Applescript that looks like this....

 

tell application "Leitz Icon Software"

set pathToScriptFolder to POSIX path of ((path to me as rich text) & "::")

open label pathToScriptFolder & "BlankLabel.LeitzLbl"

delete label objects

make new address object with properties {x position:0.3, y position:0.3, width:8.2, height:3}

tell first address object

set content to "Alex Smith

Smith inc.

NY 12345-4568"

set horizontal alignment to Center

set vertical alignment to Bottom

set scaling mode to AutoFit

end tell

save label in pathToScriptFolder & "LabelWithAddress.LeitzLbl"

end tell

Link to comment
Share on other sites

This seems to be a continuation of your earlier thread, and should have been posted as a follow-up there.

Anyway, here's a nifty way to turn a native AppleScript into a calculated one: paste it into a Filemaker text field, then copy the result of the following calculation:

Quote ( YourTextField )

and paste it into the Calculated AppleScript's Specify Calculation window.

Edited by comment
  • Like 1
Link to comment
Share on other sites

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