How to store Path selected with NSPathControl to a variable

Hi,

after creating a small application based on pure AppleScript with ScriptEditor i jumped to Xcode to improve the app.

Actually i am trying to store the path selected with my NSPathcontrol to a variable.
sounds pretty easy but i am stuck right now.

AppleScript names:

mywindow = MainWindow
mynspathcontrol = selectFolder
mytestbutton = test

In this test-scenario i want to “display dialog mypathvariable” if the button is pressed. but i am stuck how to store the path before this.
The NSPathcontrol is configured to popup mode and pressing it in my application opens an usual “open” dialog from itself. After selecting a folder it is displayed as supposed in the nspathcontrol…

wondering if anyone can help me with a final hint

best regards

Try something like this:

string value of control "pathControl" -- of whatever
--> "file://localhost/Users/Shared/"
POSIX file (string value of control "pathControl")
--> file "MBP HD:Users:Shared:"

Hi Bruce

first of all, thanks for the fast reply.

the first idea works pretty good
I didn’t manage to get the Posix way to work, but the first solution should be enough for my case if i find a solution howto replace characters out of the variable now…nets see what applescript can do in this category.

i am going to use the path later to create a bash script so i must get rid of the file://localhost section