Hi,
All my downloads go into the folder “Downloads”. I have created a shortcut using Butler which presents me a menu containing the names of the destination folders where I want to move the files from the folder “Downloads”. The menu, which Butler presents actually contains applescripts like this:
(The script below uses “1” as the destination folder)
tell application "Finder" to repeat with aitem in (get selection)
set source to quoted form of POSIX path of (aitem as text)
set destination to quoted form of POSIX path of "7:Videos:1:"
do shell script "mv " & source & space & destination
end repeat
The script works fine but I have no progress bar or any visual or audio confirmation. I don’t want a dialog box. Is it possible to see a progress bar and/or a beep after the transfer is complete?
Thanks
I meant that, the beep should “confirm” that transfer is complete. (Applescript has the habit of jumping to next line of code without finishing the earlier one.
Then i remembered, that you told me earlier, that applescript waits for shell script to execute. So I hope that beep will play only after transfer is complete. And therefore I might even add growl notification after the shell script. Correct?
Thanks. I sometimes, feel a bit lost because I am not sure when applescript’s skips lines of code and when it does not. Is there anything I must know in this regard?
When I use the script below, I get the small window for progress bar (see image: http://files.getdropbox.com/u/872430/no%20progress%20bar.png) but it does not fill itself. I remains empty all the time and then closes itself after the move is complete. Please help!
-- initialize BP Progress
---------------------
-- **** the next line must be edited to point to wherever you actually put ProgressBar. ****
---------------------
set ProgressBar to load script alias (((path to scripts folder) as text) & "Lib:BP Progress:BP Progress Bar Controller.scpt")
tell ProgressBar to initialize("Moving...") -- put name of script here (same as title bar of script)
-- Start of Script to use ProgressBar Controller
tell application "Finder" to repeat with aitem in (get selection)
set source to quoted form of POSIX path of (aitem as text)
set destination to quoted form of POSIX path of "7:V2:C:"
do shell script "mv " & source & space & destination
end repeat
tell ProgressBar to quit
You need to setup the parameters of the progress bar and to add a line to increase the value
-- initialize BP Progress
---------------------
-- **** the next line must be edited to point to wherever you actually put ProgressBar. ****
---------------------
set ProgressBar to load script alias (((path to scripts folder) as text) & "Lib:BP Progress:BP Progress Bar Controller.scpt")
tell ProgressBar to initialize("Moving...") -- put name of script here (same as title bar of script)
-- Start of Script to use ProgressBar Controller
tell application "Finder" to set selectedItems to selection
tell ProgressBar
barberPole(false)
setMax to count selectedItems -- to match the items to be processed below
setStatusTop to "moving files."
end tell
-- if the destination is always the same, it's wasted time to reset it in the repeat loop
set theDestination to quoted form of POSIX path of "7:V2:C:"
repeat with anItem in selectedItems
set theSource to quoted form of POSIX path of (anItem as text)
do shell script "mv " & theSource & space & theDestination
tell ProgressBar to increase by 1
end repeat
tell ProgressBar to quit
When i used your script, I did not notice any change. Then I realised that the progress bar moves after a file is moved. So if there is only one file that i am moving, i may never see the progress bar filled.