Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Guide ,
Feb 07, 2025 Feb 07, 2025

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

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

TOPICS
Feature request , How to , Scripting
383
Translate
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 2 Correct answers

Guide , Feb 07, 2025 Feb 07, 2025
var path = "~/Desktop";

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

Translate
Guide , Feb 08, 2025 Feb 08, 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.

Translate
Guide ,
Feb 07, 2025 Feb 07, 2025
var path = "~/Desktop";

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

Translate
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
LEGEND ,
Feb 08, 2025 Feb 08, 2025

But it's for Macs only.

 

Translate
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
Guide ,
Feb 08, 2025 Feb 08, 2025

I have test,

It  can run at windows

Translate
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 Expert ,
Feb 08, 2025 Feb 08, 2025

Hi @dublove you should use:

 

var desktopFolder = Folder.desktop;

 

See the documentation
- Mark

Translate
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
Guide ,
Feb 08, 2025 Feb 08, 2025
LATEST

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.

Translate
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