NSPathControl in AppleScript


on clicked theObject
if (name of theObject is "chooseFile") then
		chooseDefaultLocation()
		
	else if (name of theObject is "actionButton") then
         set theFolder to POSIX file folderChosen as text
-- ...
end clicked

on panel ended theObject with result withResult
	if withResult is 1 then
		set folderChosen to path name of open panel 
		set contents of text field "path name" of tab view item 1 of tab view 1 of window "main" to folderChosen
	else
		set contents of text field "path name" of tab view item 1 of tab view 1 of window "main" to ""
	end if
end panel ended

on chooseDefaultLocation()
	-- Setup the open panel properties
	tell open panel
		set can choose directories to true
		set can choose files to false
	end tell
	display open panel attached to window "main"
end chooseDefaultLocation

Isnt the problem in the on chooseDefaultLocation() handler ?

none of the posted code causes the error
in the --. part of your script there must be a routine to process the files.
There you obviously have something like


repeat with oneFile in allFiles
.
	set theFile to chosenFolder & oneFile
.
end repeat

As there is no colon at the end of the folder path you must add a colon


repeat with oneFile in allFiles
.
	set theFile to chosenFolder & ":" & oneFile
.
end repeat

No worries, I’ve figured it all out.

EVERYTHING works perfectly now …

I can’t thank you guys enough for your help …

Thanks Stefan and Bruce :wink: