Re: Passing InDesign variables from one script to an other
Re: Passing InDesign variables from one script to an other
- Subject: Re: Passing InDesign variables from one script to an other
- From: Shane Stanley <email@hidden>
- Date: Thu, 04 Apr 2013 09:51:32 +1100
On 04/04/2013, at 4:29 AM, Chris Paveglio <email@hidden> wrote:
The thing that I do is simply pass the name of the document. Since it’s a string, that is a standard data type to pass back and forth.
In the case of InDesign, it's safer to use ids instead -- they really are very close to object references.
Nonetheless you can pass object references if you really have to: you just need to wrap them in script objects. For example:
set loadedScript to load script alias ((path to desktop as text) & "To be loaded.scpt")
script aScriptObject property x : missing value end script
tell application id "com.adobe.InDesign" set theThing to document 1 end tell set aScriptObject's x to theThing tell loadedScript to doStuffWith(aScriptObject)
And 'To be loaded.scpt' contains:
on doStuffWith(theObj) set theThing to theObj's x tell application id "com.adobe.InDesign" set theName to name of theThing end tell display dialog theName end doStuffWith But it's adding a layer of complication that you can usually avoid by using ids or names.
(I haven't tried this in ASObjC, but it probably works there, too.)
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden