Skip to main content
Legend
November 11, 2024
Answered

Getting correct path string for external disk

  • November 11, 2024
  • 1 reply
  • 413 views

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?

This topic has been closed for replies.
Correct answer jduncan

`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

 

1 reply

jduncan
Community Expert
jduncanCommunity ExpertCorrect answer
Community Expert
November 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

 

sttk3Author
Legend
November 12, 2024

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.