"path to application folder from System domain"


I’m trying to use the “path to application folder from System domain” code found in on the “Path To” page of the FAQ’s ( http://macscripter.net/faq/comments.php?id=17_0_10_0_C ).

I get the error message: “Can’t get application folder” when trying to check the syntax. I don’t know if this means anything, but I don’t have admin privileges to the Applications folder (there’s another folder buried in there that I’m ultimately going for). Other examples from the FAQ page work fine.

I’m on OSX10.2.8. Thanks 8)

Try “path to applications folder from system domain”. It works fine here. Note the “s” on “applications”.

The correct ‘path to’ expression for the Applications folder (up to 10.2.8, at least) is either of the following:

path to At Ease applications folder from System domain
-- or:
path to "apps" from System domain

The ‘At Ease’ part is for historical reasons and I’m told there are technical reasons why: 1) it can’t easily be changed, and: 2) it’s not displayed when the StandardAdditions dictionary’s opened.

Thanks guys.

“path to “apps” from System domain” works fine.

A few more notes, fwiw. The error message I quoted in my original post only happens when I put my original line of code within a Finder tell block. If it’s on its own, then the syntax checks out, but I get an error when running that says “can’t get folder.” Checking the syntax also removes the ‘s’ if I type ‘applications’. Wierd.

Thanks again 8)

There have often been terminolgy conflicts in the past between ‘path to’ and the Finder. That’s why many scripters try to avoid using ‘path to’ inside a tell block.

One of 'path to’s little-advertised tricks is its ability to return the path to an application:

path to application "System Events"
--> alias "PowerBook HD:System:Library:CoreServices:System Events.app"

I imagine that when the compiler finds an expression like ‘path to application folder’, the ‘application folder’ phrase is treated as an application specifier. Inside a Finder tell block, ‘folder’ is a Finder keyword and so doesn’t make sense after the keyword ‘application’. This causes the compiler to signal an error. When the line’s not in a tell block, I suppose the compiler just takes ‘folder’ on faith as a variable that will make sense at run time. In fact, it doesn’t make sense then either so the error’s caught by the run-time engine.

The above’s just guesswork, but I think it must be pretty close to the truth.