Get Path File from AppleScript

I need to get the file path of the selected folder from AppleScript. For this, I use the following code.

--Display selection window set source_folder to choose folder with prompt "Please select directory." --Get the path of the folder set item_list to get the path of every disk item of source_folder 

I get the file path as follows:

File: Path: To: to: fodler

I want to:

File / path / to // folder

+4
source share
2 answers

Try:

 set source_folder to choose folder with prompt "Please select directory." tell application "System Events" set item_list to POSIX path of every disk item of source_folder end tell 
+3
source

Try instead of POSIX :

 set item_list to get the POSIX path of every disk item of source_folder 
+3
source

Source: https://habr.com/ru/post/1442999/


All Articles