Copy link to clipboard
Copied
Catalina 10.15.7 and ID 15.1.2
All of the Applescript sample i've tried crash with errors
Simple scripts like
Copy link to clipboard
Copied
Two of the lines in your code return errors. Try this:
tell application id "com.adobe.indesign"
set mySelection to selection
--set myCharacterStyle to character style "Italics"
--error: Can’t get character style \"Italics\"."
set myCharacterStyle to (every character style of active document whose name is "Italics")
--set applied character style of item 1 of mySelection to myCharacterStyle of active document
--error "Adobe InDesign 2020 got an error: Invalid value for set property 'applied character style'. Expected character style or string, but received nothing."
set applied character style of item 1 of mySelection to item 1 of myCharacterStyle
end tell
Copy link to clipboard
Copied
this gives an error:
Expected “from”, etc. but found property.
on the word "style" in
(every character style of active document whose name is "Italics")
Copy link to clipboard
Copied
You can also use object reference, this should work:
tell application id "com.adobe.indesign"
set mySelection to selection
set myCharacterStyle to object reference of character style "Italics" of active document
set applied character style of item 1 of mySelection to myCharacterStyle
end tell
Copy link to clipboard
Copied
this gives an error:
Expected end of line, etc. but found “reference”.
Copy link to clipboard
Copied
There do seem to be many problems with AS on Catalina—can’t help I’m using High Sierra. The script in your first post does not compile on HS (my examples do). There aren’t many AS scripters here, so you might check at macscripter
Copy link to clipboard
Copied
thanks for trying