#1 - The Finder is the same for every countries but it uses local resources.
Those used to display localized folder name are stored in :
“/System/Library/CoreServices/SystemFolderLocalizations/”
When I navigate in my home folder with the Finder, the Library folder appears as:
Macintosh HD
Utilisateurs
mySelf
Bibliothèque
On a system running in Deutsch it would appear as :
Macintosh HD
Benutzer
mySelf
Library
If we ask Standard Additions to give the path to this folder with :
set userLibraryFolder to path to library folder from user domain we get :
alias “Macintosh HD:Users:myself:Library:”
#2 - It seems that you are mixing different things.
set myApplicationsFolder to POSIX path of (path to applications folder) will return the correct path to use in AppleScript.
Here on my system running in French it returns “/Applications/”
If you navigate to this folder with the Finder speaking Deutch you will find it at :
macintosh HD
Programme
#3 - In the code below, you encapsulate your pathname between what we name in French “accolades” (maybe curly brackets in English) :{.} doesn’t explain why your script fails.
#4 - In the code below you wrote : tell application “Finder” to open file theFile
As theFile is de fined as an alias, it would be tell application “Finder” to open theFile.
open file theFile is the correct syntax if theFile is defined as a text object.
If your code fails, its not due to the instruction tell application . but to the instruction set theFile to alias (.) which works well only if the given string describe the path to an existing file.
path to applications folder as text will return :
“Macintosh HD:Applications:”
so the path that you are building is :
“Macintosh HD:Applications:MyApplicationFolder:Documents:MyUserGuide.pdf”
If you navigate in the Finder it would be at :
Macintosh HD
Programme
MyApplicationFolder
Documents
MyUserGuide.pdf
As your script fails it’s clear that there is no such file available.
#5 - simple rule : In a script, never write by hand a path belonging to the system. Always use path to to do the job.
Yvan KOENIG (VALLAURIS, France) samedi 21 mars 2015 12:10:13