AnsweredAssumed Answered

Return a value from Applescript into FMP

Question asked by mattb on Sep 13, 2010
Latest reply on Aug 10, 2017 by iaml

Title

Return a value from Applescript into FMP

Post

I'm trying to do something that seems rather simple and that I've done successfully on other platforms but I can't figure out how to do this in FMP.

I've got this 3-line Applescript:

---------------------------------

tellapplication "Finder"

get capacity of startup disk

endtell

---------------------------------

This script returns a number (the size of the hard disk in bytes).  I would like this number returned to FMP so that I can store it in a field.  Simple?  Problem is I have no idea how to accomplish this.  I played around with the Perform Applescript script step but there's seemingly no ability to capture the Applescript's result, which is what I'm after here.  I played around with the Send Events script step, which seems to make reference to capturing results to the Clipboard, but am not understanding how this could achieve my desired result.

When I used the OS9 version of Visual Foxpro, I used the "Runscript <Applescript> to <variable>" syntax which was very straightforward and gave me programmatic control of the Applescript's result.  There's got to be a way to do the same with FMP, but I'm lost.  If anybody can steer me in the right direction, or just outright tell me how to do this, I would really really appreciate it.  Thanks!

Matt Bloomfield

Outcomes