Hi,
I’m using a script that uses the place asset command to place a library asset , select it and then move it. When I execute the script two times in a row, instead of selecting the second assets, it selects the assets placed with the first execution. I use “set placedItems to place asset vAsset” to get the placed assets in a variable and then use “select placedItems” to select them in InDesign. On the second execution it will not select the last placedItems but the ones that were inserted in the first execution.
The problem is that after placing the assets I need to move them, but currently only the first assets are being moved, and I’m baffled as to finding another sure fire way to get the items that were placed with the “place asset” command.
Here’s most of my script:
on run {assetID, prefixToUse}
--set assetID to 44
--set prefixToUse to "box"
set assetID to assetID as integer
tell application "Adobe InDesign CS2"
tell library 1
set vAsset to first asset whose id is assetID
end tell
set placedItems to place asset vAsset on document 1
tell document 1
select nothing
select placedItems
set vSelection to selection
tell selection
set minX to 9999
set minY to 9999
repeat with vIndex from 1 to count of items of it
tell item vIndex
tell visible bounds
if item 1 < minY then
set minY to item 1
end if
if item 2 < minX then
set minX to item 2
end if
end tell
end tell
end repeat
end tell
move selection by {0 - minX, 0 - minY}
end tell
select vSelection
end tell
end run
Thanks in advance for any help