Skip to main content
dublove
Legend
February 8, 2025
Answered

How to get the "desktop path" of any computer?

  • February 8, 2025
  • 2 replies
  • 356 views

How to get "Desktop Path" for different computers with different usernames?

Do I need to manually set the path in the script each time?

Correct answer dublove

Hi m1b.

I tested it.

 

var desktopPath = “~/Desktop/pdf/”;

 

It is also recognized in windows.

I tried this one you gave me and it works.

 

var desktopPath = Folder.desktop;
var myPDFFile = new File(desktopPath +"/"+"pdf"+"/" + myFormattedDate + "-" + myFileName + ".pdf");

 

When you have time, research how the images fit into the column widths.
For type area,and margins.  Zoom in or out in equal proportion.
Thank you very much.

2 replies

m1b
Community Expert
Community Expert
February 8, 2025

Hi @dublove you should use:

 

var desktopFolder = Folder.desktop;

 

See the documentation
- Mark

dublove
dubloveAuthorCorrect answer
Legend
February 8, 2025

Hi m1b.

I tested it.

 

var desktopPath = “~/Desktop/pdf/”;

 

It is also recognized in windows.

I tried this one you gave me and it works.

 

var desktopPath = Folder.desktop;
var myPDFFile = new File(desktopPath +"/"+"pdf"+"/" + myFormattedDate + "-" + myFileName + ".pdf");

 

When you have time, research how the images fit into the column widths.
For type area,and margins.  Zoom in or out in equal proportion.
Thank you very much.

dublove
dubloveAuthor
Legend
February 8, 2025
var path = "~/Desktop";

I found it, and it turns out that one sentence can solve it. 

Robert at ID-Tasker
Legend
February 8, 2025

But it's for Macs only.

 

dublove
dubloveAuthor
Legend
February 8, 2025

I have test,

It  can run at windows