Open network file

Contributor ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

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

80

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

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

Translate

Translate
Participant ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

try this code, just Change the path

 

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

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
Contributor ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

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

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