Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Do not use absolute path!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Do not use absolute path!
Authored by: cnotarianni on Apr 06, '05 11:15:19AM
why do you use absolute path?
on FindPrefFolder()
tell application "Finder" to set libpath to path to home folder
set UnixPath to UnixfyPath("OS X HD:Users:chris:", ":", "/")
set prefpath to UnixPath & "Library/Preferences/"
return prefpath end FindPrefFolder

Maybe use relative path... and POSIX path of to trasform path in posix path style

set UserHome to path to (home folder) as text
set UserLibrary to UserHome & "Library:"
set prefpath to UserHome & "Library:Preferences"
set UserName to name of folder UserHome

set PosixUserName to POSIX path of UserName
set prefpath to POSIX path of prefpath


[ Reply to This | # ]
Do not use absolute path!
Authored by: powerbookg3user0 on Apr 06, '05 12:25:53PM

No, just use "~/Library/Preferences"

---
Takumi Murayama



[ Reply to This | # ]
Do not use absolute path!
Authored by: tenthumbs on Apr 06, '05 12:36:26PM
set prefsPath to (path to preferences folder from user domain as text) & "my prefs"
set prefsPath to POSIX path of prefsPath


[ Reply to This | # ]
Do not use absolute path!
Authored by: tenthumbs on Apr 06, '05 12:42:36PM
actually ment to post this: set prefsPath to POSIX path of (path to preferences folder from user domain as text) & "my prefs"

[ Reply to This | # ]
Or...
Authored by: cnotarianni on Apr 06, '05 01:11:46PM
set prefsPath to (system attribute "HOME") & "/Library/Preferences/my prefs"

[ Reply to This | # ]
Or...
Authored by: tenthumbs on Apr 06, '05 01:35:29PM

i'm not sure it's called "Library" in all system languages, tho



[ Reply to This | # ]