Article View: adobe.scripting.indesign
Article #2038[AS CS3] Place library asset and move it, or group it?
From: SuperMacGuy
Date: Wed, 14 Jan 2009 16:57
Date: Wed, 14 Jan 2009 16:57
32 lines
2630 bytes
2630 bytes
I'm able to place a library asset object. But then I need to move it to a point on the page.
I can successfully place the asset. But if I move it to page 1 of the document, all the objects in the asset move to the 0,0 point of the page, all un-arranged from their original orientation. I figured I can make a group first.
But my asset that is placed has some confounding aspects- sometimes they can be placed on or off the page (seems like they get placed relative to where the were taken from the original document, so they can be on the page or on the pasteboard); also the asset has some objects already grouped. So making a group, if I am correct, requires that I ungroup the groups first. I can't seem to make a group from a list of individual page items plus group items. I really can't ungroup the grouped objects, they must stay.
So, can I place an asset on a particular page of a document at a particular point?
If not, how do I make a group from objects + groups? (I tried making a list of object references of individual objects, even the one inside a group, but that doesn't seem to work either).
Thanks, Chris
script:
tell application "Adobe InDesign CS3" set theAsset to asset 1 of library
1
set theObject to place asset theAsset on document 1
set theAssetObjectList to {}
repeat with B in theObject
if class of B is group then
repeat with G in (all page items of B )
copy object reference of G to end of theAssetObjectList
end repeat
else
copy object reference of B to end of theAssetObjectList
end if
end repeat
set theObjectAsGroup to make group with properties {group items:theAssetObjectList}
--above line won't work
(* theAssetObjectList is like {rectangle id 7117 of spread id 180 of
document "Untitled-3", text frame id 7440 of group id 7419 of spread id
180 of document "Untitled-3"}
*)
end tell
Technical Details
Message-ID:
<59b78353.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,2c35c971252bfc68,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: SuperMacGuy@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: [AS CS3] Place library asset and move it, or group it? Message-ID: <59b78353.-1@webcrossing.la2eafNXanI> Date: Wed, 14 Jan 2009 08:57:21 -0800 Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Original-Lines: 46