Hi all,
I have a Illustrator document I use as a Master Template which has a text frame object that contains the below dummy text:
Artwork Reference
Supplier
Product Code
Product Description
(carriage return here)
Brand
My below script “seems” to select (highlight) the entirety of this text ok as I look at the document on screen:
tell application "Adobe Illustrator”
activate
–set legendText1 to "Artwork Reference”
tell document 1
select of {text from character 1 to character 66 of story 4 of document 1 of application "Adobe Illustrator”}
–tell application “System Events” to keystroke “v” using command down
end tell
end tell
BUT when the System Events line is invoked it deselects the text frame and pastes the clipboard contents the middle of the document, when I want it to replace the temporary text. It’s almost as if the text isn’t actually selected/highlighted by the native app and just a faux display from Applescript.
Even if I use the paste clipboard line instead of system events I get the same result.
The text that’s going in is coming from Excel and I’ve sorted the scripting and formatting out for that end but this step eludes me.
The only way I can get it to work is if I manually select/highlight the text frame and Command V myself which negates the need for the script.
I can’t see anything of usefulness in the Illustrator dictionary that would help either.
Any help or pointers greatly received.