I have a script that creates a few folder based on date. I am trying to get a file to be able to be moved to the folder new folder with the date.
When I use this part of the script “do shell script “sudo mv” & pref01 & " ~/Desktop/ " & folderName with administrator privileges” the file I am moving dose not go in the folder. How do I tell the script to send a file to a the new folder that the script just made?
Also I have this part of the script where I want to move a move to another folder. The Folder name has spaces in it. How do I tell applescript that the folder has spaces?
This is the script I am working with
set folderLocation to path to desktop folder as text
– calculate the folder name
set now to current date
set theApp to “FCP-”
set theMonth to text -2 thru -1 of (“00” & ((month of now as number) as text))
set theDay to text -2 thru -1 of (“00” & day of now as text)
set theYear to (year of now) as text
set folderName to theApp & theMonth & theDay & theYear
– make folder on the desktop
tell application “Finder”
if not (exists folder (folderLocation & folderName)) then
make new folder at folder folderLocation with properties {name:folderName}
end if
end tell
set pref01 to “~/Library/Preferences/com.apple.finalcutpro.plist”
set prefFolder to “~/Library/Preferences/Final\ Cut\ Pro\ User\ Data”
do shell script “sudo mv” & pref01 & " ~/Desktop/ " & folderLocation & folderName with administrator privileges
do shell script “sudo mv” & prefFolder & " ~/Desktop/ " & folderLocation & folderName with administrator privileges