September 9, 201015 yr Hello , By using Applescript script step i want to copy all files from folder name "anj"(Folder name is constant)which is onto Public folder & paste all files into another folder having name "anj" which is in Library folder .if any file is existing then without giving any message it will overwrite that file. Thanks,
September 9, 201015 yr Disclaimer: Overwriting files with no warning is a little dangerous. You are responsible for what happens (not me). It will however only overwrite matching files, so pretty safe (as these things go). The following will create the "anj" folder in the user Library folder. And it will move files from the user Public folder. If you want to use the computer level folders then follow the directions in the comments. Curiously the defaults are opposite on the two folders, so you have to add or remove a phrase to switch levels (there is also a system level, stay away from that). You could add an alert to tell you if there's no files in the Public folder to move. But likely you don't care. set pub to (path to public folder) as text -- default is user Public folder (add "from local domain" for computer Library folder) set pub_anj to pub & "anj" set lib to (path to library folder from user domain) as text -- default is computer Library folder (remove "from user domain") set lib_anj to lib & "anj" tell application "Finder" if not (exists folder lib_anj) then make new folder at lib with properties {name:"anj"} end if move files of folder pub_anj to folder lib_anj with replacing end tell
Create an account or sign in to comment