Skip to main content
Inspiring
October 17, 2023
Answered

Invalid value for set property 'appliedObjectStyles'

  • October 17, 2023
  • 2 replies
  • 630 views

Hi everyone,

Can anyone help me to fix this script? I'm getting this error: Invalid value for set property 'appliedObjectStyles'.

Thanks in advance,
Rogerio

This topic has been closed for replies.
Correct answer Peter Kahrel

Try this:

app.changeObjectPreferences.appliedObjectStyles = app.activeDocument.objectStyles.item ('Numbers');

You need an object here, a string doesn't work.

2 replies

rob day
Community Expert
Community Expert
October 17, 2023

Or maybe .appliedObjectStyle = myObjectStyle since you declared a variable for your "Numbers" style above.

 

it should be appliedObjectStyle not appliedObjectStyles

Peter Kahrel
Community Expert
Community Expert
October 17, 2023

Nope, it's appliedObjectStyles.

rob day
Community Expert
Community Expert
October 17, 2023

Right I should have checked.

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
October 17, 2023

Try this:

app.changeObjectPreferences.appliedObjectStyles = app.activeDocument.objectStyles.item ('Numbers');

You need an object here, a string doesn't work.

Inspiring
October 17, 2023

Got it! Thanks, Peter! 🙂