I'm using a folder action to create a "hot" folder, which immediately duplicates the files placed in this folder to a specific backup folder.
This is the script I'm using as folder action and it works fine:
on adding folder items to this_folder after receiving these_items tell application "Finder" to duplicate these_items to folder ("Macintosh HD:Users:photograper:Desktop:Target:") end adding folder items to
But I want to run this folder action like a normal applescript and trigger the "adding folder items" function with a "Choose folder" command. So I can manually point a specific source and target folder and get the script running.
I tried this, but no result:
set this_folder to choose folder with prompt "Select source folder:" with multiple selections allowed set target_folder to choose folder with prompt "Select backup folder:" on adding folder items to this_folder after receiving these_items tell application "Finder" to duplicate these_items to target_folder end adding folder items to
Any suggestions how to combine the two parts of scripting together so they can interact?