Jump to content

How pass AppleScript variable back to FM?


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

Recommended Posts

From within my FM app as part of a script, I do a 'Perform AppleScript' command. The AppleScript sets a variable, 'set x to 5', let's say. How can I then use the value of that x variable in the FM script that follows the 'Perform AppleScript'? Did a search in the forum on this topic, but did not quite find what I needed. Thanks.

Link to comment
Share on other sites

Your applescript would set a field in FM to the value of the variable. Check out the FM AppleScript Dictionary.

It would be much better if you could do:

return x

in the applescript and the Perform Applescript would give you that returned result. If you like that idea, go to the FM product suggestion page and put it in:

http://www.filemaker.com/company/product/feature_request.html

Link to comment
Share on other sites

Your applescript would set a field in FM to the value of the variable. Check out the FM AppleScript Dictionary.

How do you set a field in FM to the value of the AppleScript variable? (Yes, I am aware of the Dictionaries but am too new to make much sense of them.)

Link to comment
Share on other sites

Try this:

Create a new database with 2 fields

"theGreeting" and "theYear"

Then copy the following script into your script editor:

set theYEAR to 2006

set Greeting to {"Happy New Year", "Prosit Neujahr", "Bonne Annee", "Gelukkig Nieuwjaar!", "Bliain nua fe mhaise dhuit", "Felice anno nuovo"}

tell application "FileMaker Developer"

tell front database

repeat with i from 1 to count of Greeting

create new record

tell record i

set cell "theGreeting" to item i of Greeting

set cell "theYear" to theYEAR

end tell

end repeat

end tell

end tell

Link to comment
Share on other sites

  • 1 month later...

tell application "FileMaker Pro"

set myVariable to cell "Name" of current record of document "DatabaseName"

end tell

tell application "SomeOtherApplication"

activate

--some steps to pass "myVariable" to the programme "SomeOtherApplication"

end tell

So the script above takes whatever is in the field called "Name" and puts it into a variable called "myVariable". The 2nd part activates the other programme you are working with. Then you have to figure out what the AppleScript steps are to pass the value in "myVariable" to that application. I'd help but I don't know what the other application is that you are working with.

Link to comment
Share on other sites

Note that you don't have to use the Dymo software, you can set up a Filemaker layout and use applescript to select the label printer, print, and reselect the default printer.

Link to comment
Share on other sites

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