I have a macro that is working perfectly using the “Try” button directly from KM. I am trying to run the macro using the “Run AppleScript” Script command from inside Filemaker and copying the AppleScript steps from KM.
It opens the Macro and start to run it. First the Macro opens safari and logs into a webpage. That part works great. For some reason the macro can’t pull the Filemaker window back up with the Activate Application Action. I can see that Filemaker becomes active on the top Menu Bar, however, it doesn’t pull up the application. Again, the macro runs perfect directly from KM.
It seems that when I run an apple script from Filemaker. I can’t target the Filemaker application until the Macro completes. Is there a way around this?
-- ignoring application responses
tell application "Keyboard Maestro Engine"
do script "CC22AC1E-8FFC-44D1-B1EA-787603688E99"
-- or: do script "IOU - Personal"
-- or: do script "CC22AC1E-8FFC-44D1-B1EA-787603688E99" with parameter "Whatever"
end tell
When I run this from Filemaker it starts the macro. My macro Opens Safari and logs into a website. It then switched to the Filemaker Application and clicks on some items in a window.
The problem is that the Macro get's an error when trying to go back to Filemaker and click on on something in a filemaker window because Filemaker is still waiting for the AppleScript to complete.
I can defiantly see that using AppleScript to get data from Filemaker is a much better method but I'm just curious if there's a way to get back to Filemaker and work with it using Interface Control Actions instead of AppleScipt?
ah, I had issues with this, it could be that filemakers original AppleScript is waiting for a response from KM.
delete the 2 dashes in front of
– ignoring application responses and
– end ignoring
this will tell AppleScript to not wait for a response
ignoring application responses
tell application "Keyboard Maestro Engine"
do script “CC22AC1E-8FFC-44D1-B1EA-787603688E99”
– or: do script “IOU - Personal”
– or: do script “CC22AC1E-8FFC-44D1-B1EA-787603688E99” with parameter "Whatever"
end tell
end ignoring
For others that may view this post, one thing that I noticed in my solution to get it working… Make sure that you remember to include the table name in the Apple Script
So for this script to work with mine
--AS VARIABLE FROM FMP FIELD
tell application "FileMaker Pro Advanced"
set First_Name to cell named "First Name" of current record as text
end tell
I had to add the table name like this. (Merchants::First Name is the name of the field so yours will likely be a different name)
–AS VARIABLE FROM FMP FIELD
tell application "FileMaker Pro Advanced"
set First_Name to cell named “Merchants::First Name” of current record as text
end tell