• Re: Open network file

# Open network file

Contributor ,
Dec 03, 2021 Dec 03, 2021

Copied

From a script I try to open a file at my synology server

var aFile = File("\\myserver\files\myfile.pdf");
app.open(aFile);

I am getting

the specified file could not be opened because it could not be found

Any ideas why?

( The file is opened using a recorded action)

TOPICS
Scripting

Views

96

Likes

Report

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

Contributor , Dec 03, 2021 Dec 03, 2021

Hi,

your code is not working but point me to the correct direction!

I just change the backslashes from \\ to //

var aFile = File("//myserver/files/myfile.pdf");
app.open(aFile);
Thanks!

Likes

2 Replies 2
Participant ,
Dec 03, 2021 Dec 03, 2021

Copied

try this code, just Change the path

var aFile = new File("S:/myserver/folder/nameFile.pdf");
app.open(aFile );

Likes

Report

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

Copied

LATEST

Hi,

your code is not working but point me to the correct direction!

I just change the backslashes from \\ to //

var aFile = File("//myserver/files/myfile.pdf");
app.open(aFile);
Thanks!

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Learning Resources for Illustrator
Crash on launch and known issues
Fonts and Typography in Illustrator