tell application "Adobe InDesign CS2"
tell document 1
try
set TextWords to (words of text frames whose name of stroke color is "White")
on error
set TextWords to {}
end try
try
set TextWordsInGroups to (words of text frames of groups whose name of stroke color is "White")
on error
set TextWordsInGroups to {}
end try
try
set TextWordsInGroupsInGroups to (words of text frames of groups of groups whose name of stroke color is "White")
on error
set TextWordsInGroupsInGroups to {}
end try
set QtyOfAllTextWords to (count of TextWords) + (count of TextWordsInGroups) + (count of TextWordsInGroupsInGroups) as integer
set AllTextWords to TextWords & TextWordsInGroups & TextWordsInGroupsInGroups
repeat with i from 1 to QtyOfAllTextWords
set selection to (item i of AllTextWords) -- <-- This bit doesn't work!!!
delay 2
end repeat
Why can’t I select the word?
Error returned: Adobe InDesign CS2 got an error: Invalid value for set property ‘selection’. Expected object, list of objects or nothing, but received “win”.
Help anyone!