December 30, 200520 yr 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.
December 30, 200520 yr 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
December 30, 200520 yr Author 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.)
December 30, 200520 yr 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
January 4, 200620 yr Author Great sample code, thanks. I can now do what I want using the 'tell front database' 'tell record #' and 'set cell' statements you presented.
February 22, 200619 yr Hi, I just read your post. Wuuld you mind telling me how to pass data from Filemaker to an Applescript. I am trying to pass the contents of a field to an Applescript that prints a barcode label using that data using my Dymo label software.
February 27, 200619 yr If you are trying to print bar codes from Filemaker you don't necessarily need applescript. There are filemaker plug-ins for the mac which will let you display a bar-code format like a font.
March 3, 200619 yr 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.
March 6, 200619 yr 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.
Create an account or sign in to comment