• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Passing InDesign variables from one script to an other
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.)

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Re: Passing InDesign variables from one script to an other (From: Chris Paveglio <email@hidden>)

  • Prev by Date: Re: Refresh Finder view?
  • Next by Date: Re: Refresh Finder view?
  • Previous by thread: Re: Passing InDesign variables from one script to an other
  • Next by thread: Refresh Finder view?
  • Index(es):
    • Date
    • Thread