Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

go to a folder based on prompt text

I am on a 2020 iMac running 10.15.7.


I want to make an AppleScript that goes to a particular folder based on text entered after a prompt.

My script captures the text display dialog. That portion looks like this:


set theResponse to display dialog "Enter Folder Name" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue"


Then I need the script to open the folder with the name entered in the prompt. The captured prompt text is part of the folder path. The path would be something like this:


Macintosh HD:Users:user:desktop:{"PROMPT TEXT"}:Artwork


When I run the script I am able to enter the text in the prompt.

I am able to open a particular folder when the path does not have variable text.

The part I can't figure out is getting that variable text to be part of target folder path. The entire path is fixed, except for the one folder with the variable name. I hope this question makes sense.

I am very new to AppleScript and any advice is appreciated. Thank you.





Posted on May 19, 2021 11:26 AM

Reply
Question marked as Top-ranking reply

Posted on May 19, 2021 11:35 AM

Use:


set thePath to "Macintosh HD:Users:user:desktop:" & text returned of theResponse & ":Artwork"


(198332)

Similar questions

2 replies

go to a folder based on prompt text

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.