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

Getting correct path string for external disk

Community Expert ,
Nov 10, 2024 Nov 10, 2024

Copy link to clipboard

Copied

I am using ExtendScript as part of a cross-platform application such as Tauri or Electron. It is necessary to generate a POSIX path string from the File object so that it can be handled by that process.

 

ExtendScript's File.fullName can be handled normally on the local disk. However, on an external disk, it is different from the format required by the cross-platform application.

 

 

Expected Value

Actual Value

macOS

/Volumes/volume_name/path/to/file.ext

/volume_name/path/to/file.ext

Windows

D:/path/to/file.ext

/d/path/to/file.ext

 

Is there any way to get the path string indicated by Expected Value other than doing text replacement on my own?

TOPICS
Scripting

Views

155

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

Community Expert , Nov 11, 2024 Nov 11, 2024

`File.fsName` works for me on a Mac.

absoluteURI: /G-DRIVE/test/asu.jpg
fsName: /Volumes/G-DRIVE/test/asu.jpg
fullName: /G-DRIVE/test/asu.jpg

 

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 11, 2024 Nov 11, 2024

Copy link to clipboard

Copied

`File.fsName` works for me on a Mac.

absoluteURI: /G-DRIVE/test/asu.jpg
fsName: /Volumes/G-DRIVE/test/asu.jpg
fullName: /G-DRIVE/test/asu.jpg

 

Votes

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 Expert ,
Nov 11, 2024 Nov 11, 2024

Copy link to clipboard

Copied

LATEST

Thank you, File.fsName worked for both macOS and Windows.

The format would be something like D:\path\to\file.ext on Windows, but the cross-platform application accepted that format when I tried it.

Votes

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