I have a selected frame, in which I want to select the contents within. I figured I could use System Events to do this. But for some odd reason this does not work?
Maybe there is a better method? Any help would be greatly appreciated.
tell application "Adobe InDesign CS4"
activate
tell application "System Events"
tell process "Adobe InDesign CS4"
tell menu bar 1
tell menu bar item "Object"
tell menu 1
tell menu item "Select"
tell menu 1
click menu item "Content"
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
Thanks Shane, this works great for selected text of a frame, but I am actually seeking the way to direct select the graphic within a selected frame. Sorry I did not specify this
Thank you very much Shane. I modified this a bit and it seems to work very well if either the image or its frame is selected.
tell application "Adobe InDesign CS4"
tell document 1
if class of item 1 of selection is in {rectangle, oval, polygon} then
try
set ImagType to image type name of graphic 1 of item 1 of selection
set theImage to graphic 1 of item 1 of selection
set theImage to item 1 of selection
display dialog "Image selected"
end try
else if class of item 1 of selection is in {image, PDF, EPS} then
set imageType to image type name of item 1 of selection
try
set theImage to item 1 of selection
display dialog "Image selected"
end try
end if
end tell
end tell