Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find object's id - Indesign CS4/VBscript 1

Status
Not open for further replies.

dv1

Technical User
May 15, 2009
8
US
IndesignCS4-VBscript

I need to find the ID of a selected item, but I don't know what I'm doing. This is what I have so far(but it doesn't work):


Function main()
Set myInDesign = CreateObject("InDesign.Application.CS4")
myInDesign.Activate
If myInDesign.Documents.Count <> 0 Then
If myInDesign.Selection.Count <> 0 Then
Set ObjID = InDesign.Selection.Pageitems.ID
MsgBox (ObjID & "Test")

Else
MsgBox ("Please select an object and try again.")
End If
Else
MsgBox ("Please open a document, select an object, and try again.")
End If
End function
 
The below script may help you:

Set myInDesign = CreateObject("InDesign.Application")
Set mySelection = myInDesign.Selection
msgbox(myselection.item(1).id)
 
That worked perfect, Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top