scripting to open a file in illustrator

Community Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Hi everyone 

Can I open an illustrator file with just having the path without opening the dialog box through scripting?
Thanks in advance!

 

TOPICS
Scripting

Views

60

Likes

Translate

Translate

Report

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

Participant , Jul 14, 2021 Jul 14, 2021
Hey @hosseinh74814055 try thisvar myFile= new File("C:/FILES/name.eps");//change path app.open(myFile);

Likes

Translate

Translate
Participant ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Hey @hosseinh74814055 

try this

var myFile= new File("C:/FILES/name.eps");//change path
app.open(myFile);

Likes

Translate

Translate

Report

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 Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Thanks!

It didn't work. this is the error I received:

hosseinh74814055_0-1626278548125.png

 

Likes

Translate

Translate

Report

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
Participant ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

you must to change the path   "C:/FILES/name.eps" is just an example 

please change path where you have the file you need open 

 

Likes

Translate

Translate

Report

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 Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

I changed it to my path:
"C:\Users\Rice\Documents\AE2.ai"

 

Likes

Translate

Translate

Report

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
Participant ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

Change for this

 

"C:/Users/Rice/Documents/AE2.ai"

Likes

Translate

Translate

Report

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 Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

LATEST

It worked!

Thank you so much!

Likes

Translate

Translate

Report

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