Can't Access Library Folder?

i’m confused. i’m trying to move a file to a directory within the users Library in their home folder. it works fine if i write in the enitre path, as in:


tell application "Finder"
move file "test.txt" to "Macintosh HD:Users:somebody:Library:Application Support:SomeApp:Version:UserPresets:"
end tell

but their is a good chance that a user may have renamed their hard drive and they will certainly have a unique name for their home folder. so i tried this:


tell application "Finder"
set homePath to path to home folder	
move file "test.txt" to "homePath:Library:Application Support:SomeApp:Version: UserPresets:"
end tell

but of course it doesn’t work. it will however let me go as far as:


tell application "Finder"
	move file "test.txt" to homePath
end tell

but i can’t get beyond that point. there must be a simple way. any help would be great. :slight_smile:

Maybe this will work (tested in OS X 10.3.5)

set user_presets to ((path to application support from ¬
	user domain as Unicode text) & "SomeApp:Version:UserPresets:")

tell application "Finder" to move file "test.txt" to alias user_presets

If you need it to work on pre-10.3 systems, this should work:

set user_presets to ((path to current user folder as Unicode text) & ¬
	"Library:Application Support:SomeApp:Version:UserPresets:")

tell application "Finder" to move file "test.txt" to alias user_presets

– Rob

thanks so much. this is perfect. :smiley: