Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Run a script js on startup without any open document

Explorer ,
Jan 26, 2023 Jan 26, 2023

Bonjour à tous,

J'ai créé un script qui me permet de choisir quel document ouvrir. Mon problème est que j'aimerais que ce script s'éxécute automatiquement dès le lancement de Illustrator quand aucun document n'est encore ouvert.

Bonne journée
PM

TOPICS
Import and export , Scripting , Tools
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 26, 2023 Jan 26, 2023

create a Startup Scripts folder in the default Illustrator folder and place the scripts you want to run there

 

C:\Program Files\Adobe\Adobe Illustrator 2023

 

more info on startup scripts here

https://ai-scripting.docsforadobe.dev/introduction/executingScripts.html

Translate
Adobe
Mentor ,
Jan 26, 2023 Jan 26, 2023

Mac or PC?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

Hi @Met1 I'm on PC windows 11 Illustrator 26.0.3
PM

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jan 26, 2023 Jan 26, 2023

Take a look at 4 here - https://www.guidingtech.com/top-ways-to-run-apps-at-startup-on-windows-11/

I don't know how to do it, but it's possible you can have a PowerShell script launch Illy and then your script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2023 Jan 26, 2023

create a Startup Scripts folder in the default Illustrator folder and place the scripts you want to run there

 

C:\Program Files\Adobe\Adobe Illustrator 2023

 

more info on startup scripts here

https://ai-scripting.docsforadobe.dev/introduction/executingScripts.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jan 26, 2023 Jan 26, 2023

Ah! I was over-complicating it, I thought we needed to script Illy opening too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2023 Jan 26, 2023

it happens, you were going the generally speaking way (which it may work) but illustrator has a way to natively handles startup scripts.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 27, 2023 Jan 27, 2023

Merci beaucoup @CarlosCanto Ã§a fonctionne ! 
Est-il possible d'uniquement et seulement déclencher le script lors du démarrage d'illustrator? Pour le moment mon script se lance automatiquement lors du démarrage mais il se lance aussi automatiquement dès que j'ouvre un fichier sr Illustrator, j'aimerais qu'il ne s'ouvre qu'une seule fois lors de l'ouverture.

Merci aussi @Met1 pour votre aide.

PM

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2023 Jan 27, 2023
LATEST

Hi @polotrobo, I tested putting a script alert('hello') into the startup scripts folder and when I ran the script it executed twice—once immediately on launch, and then again when Illustrator displayed the "Suggestions/Recents" window/dialog. It didn't show it at any other time that I could trigger. I'm on MacOS 13.1, Illustrator 27.2. (I also tried the Application-specific startup scripts folder and the behaviour was the same.)

 

So obviously the second execution is a bug, but the script could check the timestamp and ignore the second one I guess. But you are on Windows so it's quite possible your experience is different.

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines