moving files - no set directories

Heeelp!

I’m trying to create an installer package where I copy files from the package (in this case a screesaver file we created) to a temp folder.

from there, I need to rename the file (which applescript I have working) and then move it over to the /USERS/current_user/library/preferences/byhost folder.

I found this script from the forums here which seem to work only I would need to specify the source and target directories which wouldn’t work for me as I need to have it change from one installation to another.

set param_list to {"Abstract.slideSaver", "Mac HD:abstract:", "Mac HD:users:jng:Pictures"}
set {file_name, source_folder_path, dest_folder_path} to param_list
set file_reference to (source_folder_path & file_name) as alias
set dest_reference to dest_folder_path as alias
tell application "Finder"
	move file_reference to dest_reference
end tell

for now, I’m trying to get the script moved and this works fine, how do I change “Mac HD:users:jng:Pictures” to a more dynamic “~/Pictures” and get it working?

thanks

you want to use the glorious "path to " command. Here are a few you might find helpful.

path to home folder
path to users folder
path to pictures folder

path to pictures folder
-- returns HardDrive:Users:CurrentUser:Pictures
POSIX path of (path to pictures folder) -- If you need a Unix style path

Jim Neumann
BLUEFROG

Wow! That’s twice in one day, James! :lol:

heheheh :smiley:

cool!

that worked well but now I needed to move the file to a

/users/jng/library/preferences/byhost

folder…

how do I concatenate “preferences/byhost” to path to pictures folder?

thanks,
jayson
-applescript newb!

set byhost to (path to preferences as string) & "byhost" as alias
-- or
set byhost to POSIX path of (path to preferences as string) & "byhost"

haha! almost got it working!

your script worked well! thanks!

now my only problem is the source folder, i need it to be set to a /private/tmp

:smiley:

any idea?

Save Our Coercions, James :wink:

set byhost to POSIX path of (path to preferences) & "byhost"

What’s the path to a hidden folder like /private/tmp?

thanks!

-jayson

set sd to path to startup disk as Unicode text
set privPath to (sd & "private:tmp") as alias

cool! worked like a charm.

thanks a lot James!

-jayson