Can Quoted Form and Text Returned be combined?

As per the title,

Can these two lines be combined?


set ProjectDestinationName to text returned of (display dialog "Type your Project Name" default answer "")
set ProjectTemplateFolder2 to quoted form of POSIX path of (ProjectDestinationName) -- ADDED

You may use:

set ProjectTemplateFolder2 to quoted form of POSIX path of (text returned of (display dialog "Type your Project PathName" default answer "")) -- ADDED

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 6 avril 2020 11:02:34

Only here Posix path no need at all.
Because if you provide Posix path in the dialog, you already have Posix path, and should not ask for the Posix path of Posix path :frowning:


set ProjectTemplateFolder2 to quoted form of (text returned of (display dialog "Type your Project PathName" default answer ""))

You need Posix path only when you provide in the dialog HFS path. But why provide HFS path and not provide directly Posix path, which need less typing…


"Macintosh HD:Users:Robert:Working:Test Project:" -- HFS path
"/Users/Robert/Working/Test Project" -- Posix path

So, makes sense to do your prompt clear:


set ProjectTemplateFolder2 to quoted form of (text returned of (display dialog "Type your Project's Posix path" default answer ""))

Maybe the asker paste an Hfs path copied from some source.
I do that quite often.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 6 avril 2020 15:38:50

We don’t know why the OP use this protocol.
I just assume that he has some reason.

Choosing to use Display dialog may make sense if he wish to be able to type from time to time and to paste most of the time.

When I search for the files containing a given localized string, I get a text file containing several Hfs paths.
I study the list then when I have decided which one will be used, I select it, copy it and call a script which will grab the path from the clipboard to open it with BBEdit.

Using a display dialog in which I would be able to paste would not be ridiculous which woul give the ability to edit the path before validate it.
In such case, choose file would not help.

Remember that when somebody ask here, what he write is a kind of iceberg.
1/10 of the infos are available but there are 9/10 of am not a sooth sayer.

Of course we may propose different versions but there is no need to tell the OP that what he does is bad when we don’t know why he behave this way.

From my point of view, doing that is more rude than writing some statements for which I was blamed.
We helpers are supposed to have a meaningful level of knowledge, askers aren’t.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 6 avril 2020 19:21:03

I guess, the main problem of the OP is not in the combination of these 2 code lines, but that the OP wants to create a reference to the project, specifying only the name of the project, without specifying the parent folder of the project. And this is impossible.

But, let the OP answer itself. Now I have to go to work.