Copy link to clipboard
Copied
how can i run script automatically at strat of illustrator?
1 Correct answer
Try to replace your existsing code with
if (app.documents.length) {
app.executeMenuCommand('Print')// JavaScript Document
//Here, add your more code if exists
}
// JavaScript Document
Explore related tutorials & articles
Copy link to clipboard
Copied
On Mac I use Keyboard Maestro to trigger a script on startup or whenever Illustrator launches.
Copy link to clipboard
Copied
Locate your version of Adobe Illustrator in your Applications Folder. inside the app folder, create a new folder called "Startup Scripts". Then you can place one or more .jsx files into that folder and they will run automatically whenever illustrator is launched.
Copy link to clipboard
Copied
hey @Disposition_Dev ! it works good But,
every time I run another script, Startup Script also appears
How Can I stop this, Only needs run it, when ilustrator Starts
Copy link to clipboard
Copied
Hmm. I'm not sure. Any scripts in that folder should only get executed when illustrator is launched..
Copy link to clipboard
Copied
the guide reads "the scripts run automatically when you launch Illustrator and each time you run a script."
In theory, if you have your script run only when there are no open documents, that should do the trick.
Copy link to clipboard
Copied
hey @CarlosCanto
please check out my code maybe Im doing something wrong
//Welcome script
var w = new Window ("dialog", "", undefined, {closeButton: true});
w.alignChildren = "right";
var texto= w.add("statictext", undefined, "BIENVENIDO GERSSON");
w.show ();
Copy link to clipboard
Copied
Hi Gersson, your script works great, what do I suppose to check?
Copy link to clipboard
Copied
indicate to script only works when Ilustrator is launched , maybe we can fix this Issue !!
Copy link to clipboard
Copied
add what I suggested and see if it works
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hello @CarlosCanto could you help me clarify here ?
"the scripts run automatically when you launch Illustrator and each time you run a script."
so yes of course the startup script will pop up when I run another script
Can we prevent this from happening? Or in other words, is it possible to have a scrip run run ONLY on startup ?
If I take this script for example
//Welcome script
var w = new Window ("dialog", "", undefined, {closeButton: true});
w.alignChildren = "right";
var texto= w.add("statictext", undefined, "BIENVENIDO GERSSON");
w.show ();
do I need to specify or target something more in the script itself to make it run only when launching the app ?
Thanks for your wisdom!
-
www.instagram.com/mugen_labz/
Copy link to clipboard
Copied
This is the error message I'm getting
Copy link to clipboard
Copied
This is the error message I'm getting
Copy link to clipboard
Copied
Is this error with a particular script or every script that you put in the startup folder? From the error, it looks like an error specific to the operation this script does. Did you make sure all the requirements for the script to run are met at the application start? For ex. if the script expects an open document the script will crash and cause errors at the startup if the condition is not handled in the code.
-Manan
Copy link to clipboard
Copied
We can't really help any further until you share your script so we can figure out what might be causing the issue.
If you've put your script into the appropriate location and it's still not working, then we can't even suggest anything else until we know more. Otherwise we'd just be taking random guesses in the dark and that's not productive for any of us or for you.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Salut!
Normal, au démarrage de AI, il n'y a aucun document ouvert?
Copy link to clipboard
Copied
charu
It was an attempt to solve the printing problem we were talking about at the time.
But now, every time I open a new document and run the script they wrote to me - a print window opens. The goal - to run my script and print without opening a print window.
So I need to somehow find a solution for me (even for a nominal fee).
If it seems to you - we will continue via email in private.
Copy link to clipboard
Copied
Try to replace your existsing code with
if (app.documents.length) {
app.executeMenuCommand('Print')// JavaScript Document
//Here, add your more code if exists
}
// JavaScript Document

