I’m trying to write a script at work so I can move customer folders that have been billed to an archive folder. When I run the script I want to be able to enter a job number and not the whole folder name ie… (customer folder is called “0001 - bobs”) I want to only type in the 0001 in the dialog window and have applescript find it in my customer folder and move it to an archive folder. I am kind of new to applescript.
I wrote my first ‘do shell script’ all on my own with ‘find’ and I realized that applescript can do this
set c_folder to (choose folder with prompt “Choose the customer folder:”)
set a_folder to (path to desktop) – archive folder
display dialog “Enter the job number:” default answer “00000”
set j_num to text returned of result
tell application “Finder”
move (every folder of c_folder whose name begins with j_num) to a_folder
end tell
Thanks, but I keep getting an error saying "can’t get every folder of the folder “jobs_Volume:Customer Jobs”. I am trying to move files that are on a server to an archive folder on the same server. Didn’t know if that made a difference.