Skip to main content
Known Participant
September 3, 2021
Answered

Illegal use of reserved word 'import'

  • September 3, 2021
  • 1 reply
  • 1813 views

I wish to clean my illustrator script by splitting my script into smaller .js files but I seem to get this error when I want to import functions from other files. Any ideas? Does ai not allow this? Thanks!

This topic has been closed for replies.
Correct answer CarlosCanto

 are your scripts part of an Extension?

 

for regular jsx scripts, use #include at the top of your main script, import is not used in the illustrator scripting context

1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
September 3, 2021

 are your scripts part of an Extension?

 

for regular jsx scripts, use #include at the top of your main script, import is not used in the illustrator scripting context

Known Participant
September 3, 2021

Yes I've tried #include and it works. TY

Participant
October 15, 2021

i am a novice and i don't understand it well。can i trouble to put a case?thanks!