A very humble service installer

Hello

The other day I wrote a service installer for a guy that had made a service he wanted to share, come to think that it might be of some use for some of you. What do I know?

This service installer works for Snow Leopard - Mac Os X 10.6 only.

It copies one service into the /Users/Username/Library/Services
folder.
Save this script as an application bundle in Script editor:


(* ServicesInstaller: Installs a service into the users Services folder.
 © McUsr and put into the public domain
*)
set servicesPath to (path to "dlib" from user domain) & "Services:" as text
set serviceFile to (path to resource "FILENAME") as text
tell application "Finder"
	duplicate file serviceFile to folder servicesPath replacing yes
	open servicesPath
end tell
display dialog "The service is installed in your servicesFolder"

-- Do you have any readme file youd like the user to read, drop it in the same place as the 
-- Service file and uncommend the line below and edit the file name.
-- YOU SHOULD PROVIDE AN ALIAS TO THE README FILE INTO THE FOLDER WHICH YOU PUT THE SERVICE INSTALLER.
--
-- REMOVE PARENTHESIS AND ASTERISKS TO ACTIVATE CODE THAT DISPLAYS READMEFILE AUTOMAGICALLY.
(*
set readmefile to (path to resource "Readme.rtfd") as text
tell application "TextEdit" to open readmefile
*)

To Use: drop the applet somewhere on your disk.

Right click on it and choose “show package contents”
Navigate into the resources folder.
Drop your service there.
Start up the applescript editor.
Replace the text in the script which says FILENAME, with the name of your
service (remember the extension) and you are good to go.
Exit AppleScript Editor.
Rename the applet to something like YourServiceNameInstaller
Test it on your own folder.
Pack it in a zipfile or whatever.
Spread your services!

Best Regards

McUsr

Hi,

the keyword copy assigns a value to a variable like set,
the proper command to copy a file is duplicate.

As custom services have been introduced in Snow Leopard, this installer is for 10.6 only.

Hello Stefan!

It might not be the proper command according to the dictionary, but it works.
I corrected it to use the proper word.

I’ added that it is only for Snow Leopard.

Thanks for looking over.

Best Regards

McUsr