Please see license.txt for licensing information. This readme.txt covers version 1.1.4 -Overview: OpenService is a MacOSX (cocoa) Service Application. It should be available from all OSX applications in their application menu under Services->OpenURL, however some/many non-Cocoa applications will not support it. It does work with Terminal.app It will launch highlighted URLs (including local directory paths) via the OSX Service framework, using mouse/menu or a keyboard shortcut. -Building: If you are using the precompiled binaries, see below, Installation (or Upgrading) If you would like to build it yourself, get the "src" package, open OpenService in the Project Builder, clean all targets, and then build (both under the Build menu). Two particular compile-time defines can be changed in defines.h to control debugging output. The result will be OpenService/build/OpenService.service. -Installation: Place the OpenService.service application in ~/Library/Services/. (You may need to create this directory if this is the first one you are installing) If you are installing it for all users, you should be able to place it in /Library/Services, but I haven't tested this. Log out and log back in, "OpenURL" should appear in the Services menu (will be dimmed out if no text is selected or if the application doesn't support it) and the hotkey will be displayed with it. (Command-/ if you didn't modify it. Sometimes Shift-Command-/, I think if an application overrides Command-/) Advanced users: If you don't like logging out and back in (who does?) you can try my UpdateDynamicServices program. No guarantees, and Apple doesn't seem to have perfect the system call it uses, but it claims to update the list of services without log off/on. Let me know your experience with it, or other ideas: http://www.osxtreme.net/software/UpdateDynamicServices -Upgrading --From version 1.x, 0.x and before If you already have OpenService installed/running, the upgrade is easier. If you are using the Finder and binary distribution: 1) go to you homedirectory/Library/Services 2) drag OpenService to the trash 3) drag OpenService from the mounted disk image in 4) kill the existing OpenService via one of: 4a) step 1 of the command line instructions 4b) Use Process Viewer and kill OpenService 4c) log out and log back in If you prefer from the command line, or are building your own: 1) ps -axc | grep OpenService | awk '{print $1}' | xargs kill -HUP 2) cd ~/Library/Services (or wherever it is installed) 3) mkdir DISABLED 4) mv OpenService.Service DISABLED/OpenService.service. (keep the old one as a backup) 5) mv /OpenService.service . (note the period at the end there) 6) Use the OpenService again - the window service (or something? :) will start the new version automatically from that location. -Use and Configuration: In a suppported application (Terminal.app for instance), highlight a URL (including the http:// or whatever). Terminal->Service->OpenURL and it will launch your web browser (if needed, via InternetConfig) and open the URL in the current window. (I'd like to use a new window, that needs to be figured out) By default, the hotkey is Command-/ (slash). Hopefully this doesn't conflict with anything. I preferred Command-Shift-Z but that is used in many applications as Redo. A single-hand keystroke is preferable for quick URL launching, so Command-/ seems simple enough. This is a localized string, so you many need to check your menu to verify the hotkey. If you would like to change it, find your locale.lproj directory in the application, and edit ServicesMenu.strings - change the key (default is "/") in the line that reads: "/OpenURLKey" = "/"; to whatever key you want. You need to log out and back in for this change to take effect. In case you are wondering about the strange name "/OpenURLKey": if you don't have a localized version of the string, it will use the first character of that name, so I started it with a "/" so that would be the default. (note - if you are navigating with the Finder, you can control-click on OpenService.service and select "Show Package Contents" to find the localization files) (note - for some translations, the console does not seem to support the extended non-ascii characters, they show up as \\351 etc.) The first thing that will happen is that the text selection will be cleaned up. Any text that looks like it should start with http:// will have that prefixed (if it starts with "www" or ends with .com, .net, .org). If a URL seems to continue on to the next line, the newline and any whitespace encountered will be discarded. Any other whitespace and newlines will be compressed. If a piece of text has a colon, it will not have http:// prefixed to it. If it has an at sign (@), it will have mailto: prefixed to it. Then it will attempt to scan the given string for any URL strings, ignoring whitespace and any sub-strings that don't begin with the supported protocols. If it finds any of those, the first will be handed to the browser. If none are found, it passes the whole URL over (in case it is a local directory path or a non-supported URL). This is intended as a convenience to grab URLs out of a larger selection of text. (The supported protocols are http, https, mailto, ftp, news help, and file - if a protocol isn't supported, it just means OpenService won't pick it out of a larger selection, you can still open it by selecting just the URL) The command being used seems to be identical to the /usr/bin/open command, except that it also handles http:// urls correctly. Folders will be opened in the Finder. Applications will be started. Files will be loaded into their default application. Other things that are known to work: help:goto_helpcenter=developer Starts the Help Viewer in the Developer Help Center help:search=word Tell the Help Viewer to search for text on the open Help Center Folder/Directory names For instance, if you had a path on screen (such as the output of the pwd command), highlight the whole line, and it will be opened in the Finder. (just like /usr/bin/open) The default compile may or may not have debugging turned on (likely that it does), you can see the output in the Console application, and change this in the file defines.h if you would like to rebuild it with Project Builder -Notes on startup/installation: The login process scans the the Services directory in the standard Library directories (/System/Library, /Library, ~/Library, for instance), and in the Application directory. This way, you can have a standalone service or provide one as part of another application. Note this scan only seems to happen on login, including the reading of the plist files, so if you make changes to the plist, or install/rename the application or components, you will need to log out and back in to get the changes. If you want to simply replace the binary (like I do, when debugging new versions) you should be able to send the OpenService.service a HUP signal, move/remove the old application, and place a new one. The next time you use the Service menu, the OS will call the new binary right up. Nifty. Also, a note for services: Apple suggests that standalone services use the .service extension, although in reality, they are identical to .app files/directories. -Credits: Thanks to my friends for the original request for this feature and beta testing Thanks to Stas Pietrucha and his Terminal Services for providing inspiration and example code: http://homepage.mac.com/stas/terminalservices.html Thanks to Ryan Hamilton for suggesting the improvements that became 1.0 Thanks to Stˇphane Moureau for offering the French translation, thereby inspiring the localization effort. -TODO: -Add more versions of localized strings -fix upgrade instructions for dmg users -support more url types in both clean and make -Make an installer? Seems unlikely, this is pretty basic, just one application. TinkerTool has a one, tho -Support opening in new window. NSWorkspace doesn't give me much to play with here, need to investigate more -Find a way to reload services without logoff/on? -NSUpdateDynamicServices() is a start -Error messages passed back for failures? -Error messages suppresion for non-interesting -Take debuging flag on cmdline -Support other url types to be picked out of text (ftp:, help:) -Make an application icon / logo -Need a preference storage/controller for: -debug settings -tld list -scheme/protocol list -hotkey -maybe support sending to a search engine -BUGS: -www with a linebreak will not get http'ized -so need to do two passes with scanner in cleanURL? -on login, hotkey will not work until you at least use the mouse to open the application menu (known Apple bug) -Changes: v0.0.1a 2/3/2002 First semi-release v0.0.2a 2/3/2002 Added hotkey to menu Added license and readme Changed file extension to .service in package v0.0.3a 2/3/2002 Moved OpenURL out of 'Open' directory Made ProjectBuilder file have correct default .plist v0.0.4a 2/3/2002 Support scanning for http URLs in entire selection v0.0.5a ProjectBuilder builds .service instead of .app v1.0.1 3/3/2002 #1 more modular code design of the text scanning, including new class for URL scanning/ transforming #2 before http:// scanning: #2a: compress all whitespace #2b: remove newlines (and then leading whitespace) after suspected URLs #2c: ^www -> prefix http:// #2d: .[net|org|com]$ -> prefix http:// #3 Minor method change: Opens first url found, instead of the last one. #4 New license for this version, see license.txt #5 Source and binaries available in seperate packages v1.0.2 3/3/2002 Disk image for binary release Updated readme.txt v1.1.0 3/8/2002 source-only release Fixed init/dealloc methods, thanks to Jean-Frangois Veillette for finding the bug and suggesting the fix. Localization support added, all strings printed to console as well as the OpenURL Menu item are localizable (currently English) v1.1.1 3/9/2002 Added French translation, thanks to Stˇphane Moureau Added localiztion support for the hotkey - will default to '/' v1.1.2 3/20/2002 Added mailto: guessing, and ability to pick out given protocols (not just http) from selection Prevented prefixing http:// for text with a colon in it v1.1.3 3/24/2002? Fixed "prepending" text to "prefixing" v1.1.4 8/5/2005 Upgraded to XCode 1.5 project Changed string for Services menu to avoid conflict with SystemUIServer in 10.3+ Enabled some debug output by default Version and debug status printed on startup Packaging: % cd OpenService % mv build/OpenService.service . % dmg_backup --nolog --volprefix "OpenService" "1.1.4" OpenService.service readme.txt license.txt % mv /tmp/backup.1.1.4.20050805.001.dmg ../OpenService.1.1.4.dmg % rm -rf build OpenService.service % cd .. % zip OpenService.1.1.4.dmg.zip OpenService.1.1.4.dmg % zip -r OpenService.1.1.4.src.zip OpenService % scp OpenService.1.1.4.dmg.zip OpenService.1.1.4.src.zip OpenService/readme.txt