5

I need to get the file path of the chosen folder from AppleScript. I am using the following code to do this.

    --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 am getting a file path like this:

File:Path:To:the:fodler

What I want is:

File/Path/To/the/folder

2 Answers 2

5

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
Sign up to request clarification or add additional context in comments.

Comments

3

Try getting the POSIX path instead:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.