Making Finder Folders

theLocation is defined as a POSIX PATH but the Finder is perfectly unable to treat such object.

Try to use :

tell application "Finder"
       open POSIX file theLocation
 end tell

Yvan KOENIG running Sierra 10.12.6 in French (VALLAURIS, France) vendredi 22 septembre 2017 12:01:11

I’ve tried different combinations, but I get errors every way I try it.

When I try

tell application "Finder"
		open folderpath
	end tell

I get: Error: Finder got an error: Handler can’t handle objects of this class.

When I try what you sent, it errors with:

Error: Finder got an error: Can’t get POSIX file “/Users/xxx/Dropbox/Team Folder/0 - Working Files/Dropbox/”.

Oops, I forgot that POSIX file belongs to the OSAX Standard Addition so it can’t be called in the tell application “Finder” block.

Try :

set theFile to POSIX file theLocation
tell application "Finder"
	open theFile
end tell

If it continue to fail add these instructions to check that the file really exists.

tell application "System Events"
	exists disk item theLocation
end tell

It will return true if the item exists, false if it doesn’t exist.

Yvan KOENIG running Sierra 10.12.6 in French (VALLAURIS, France) vendredi 22 septembre 2017 19:07:59

Wonderful. Thank you! It was enough to get me where I needed to go.

The final command that worked was this:

set theFile to POSIX file folderpath
	tell application "Finder"
		activate
		open theFile
	end tell