Hello.
I have made a little applet i figure will be usable, since there are certain scripts I like to have quick access to.
It works like this: you click on the droplet you have installed on the finder toolbar, and you’ll get presented a list with scripts, that you can run. (Not script bundles.) When you have a script you’d like to see on that menu, you just drag and drop the script onto the toolbar icon. (I used the Generic Preferences icon, from the “/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/” folder, opened it in preview, copied the image, and pasted it onto the icon in the droplets icon, in the file-information dialog of finder.
I also inserted the item that says that “application is an agent” in the plist file, within its Contents folder.
So I have made an applet, with an extra folder : “HelperScripts”, and inside that folder a folder named Obsolete, so I have a place to put the scripts I am not currently using.
There is one script that comes with it, and that is the one named OpenHelperScriptsFolder.
Caveats:
You’ll have to see to that the scripts you stuff it with, has an ‘.scpt’ extension, and that extension aren’t hidden in Finder.
Edit
The caveat still exists, if you drag files into the folder, but the open handler takes care of the problem when scripts are dropped onto it.
Edit++
I have resolved the second issue, when you drop a file with either no name extension or name extension hidden,
by fixing it. This leads however to a somewhat slower script execution the times you modify the folder by dropping items into it, one way or the other.
I hope you like it still.
The Applet (you must save it as an application bundle).
-- © 2013 Copyright McUsr and put in public domain
-- Icon copyright © Apple Inc.
property app_nm : "Servant"
property lastmodDate : ""
on run
script o
property l : {}
end script
local helpScriptsFolder, md
set helpScriptsFolder to (path to resource "HelperScripts") as text
tell application "Finder"
set md to modification date of folder helpScriptsFolder
if md ≠lastmodDate then
set o's l to every document file of folder helpScriptsFolder
local tc
set tc to (count o's l)
repeat with i from 1 to tc
if extension hidden of item i of o's l is true then
set extension hidden of item i of o's l to false
end if
if name extension of item i of o's l is "" then
set name extension of item i of o's l to "scpt"
end if
end repeat
set lastmodDate to md
end if
end tell
local helperScripts, app_path
set app_path to POSIX path of (path to me)
set app_path to app_path & "/Contents/Resources/HelperScripts"
set helperScripts to paragraphs of (do shell script "ls -1 " & quoted form of app_path & " |sed -n 's/.scpt$//p'")
tell me
activate
set run_script to choose from list helperScripts default items item 1 of helperScripts with title "Servant" with prompt "Choose a Script to run"
end tell
if run_script = false then
tell application "Finder" to activate
error number -128
end if
set run_script to POSIX file (app_path & "/" & run_script & ".scpt") as alias
tell application "AppleScript Runner" to run script run_script
tell application "Finder" to activate
end run
on open the_items
set app_path to (path to me as text) & "Contents:Resources:HelperScripts" as alias
tell application "Finder"
repeat with anItem in the_items
if extension hidden of anItem is true then
set extension hidden of anItem to false
end if
if name extension of anItem is "" then
set name extension of anItem to "scpt"
end if
move anItem to folder app_path replacing no
end repeat
end tell
end open
The helper script that opens the HelperScriptsFolder.
-- © 2013 Copyright McUsr and put in public domain
-- Icon copyright © Apple Inc.
set app_path to POSIX path of (path to current application)
set app_path to app_path & "/Contents/Resources/HelperScripts"
do shell script "open " & quoted form of app_path
I have a ready made version here