AnsweredAssumed Answered

Return a value from Applescript into FMP

Question asked by mattb on Sep 13, 2010
Latest reply on Feb 4, 2018 by mdgas


Return a value from Applescript into FMP


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



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