I really like those links to be clickable from my web-browser, I also really love eclipse.
Here's how you make them play together:
Look for the play.editor
option and modify it.
play.editor=playclipse://open?url=file://%s&line=%s
Add an error somewhere and verify that the new link shows up.
Fire up AppleScript-Editor and copy&paste this in a new window
on open location uri
tell application "Eclipse"
set i1 to offset of "?url=" in uri
set i2 to offset of "&line=" in uri
set i3 to the length of uri
set myfile to text (i1 + 12) through (i2 - 1) of uri
set myline to text (i2 + 6) through i3 of uri
activate
open myfile
tell application "System Events"
keystroke "l" using {command down}
keystroke myline
key code 36
end tell
end tell
end open location
Use the "save as" function (yep, this app still has save as, even in lion)
and save it as an application package to a location of your choice.
I put mine to /Applications/Play/
where i also keep all my play versions.
After that: close the applescript editor again.
Now navigate to the script-application you just created, right click on it,
navigate to Contents/Info.plist
, open that in a text editor and insert
CFBundleIdentifier
and CFBundleURLTypes
as shown below
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>play.EclipseLauncher</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>playclipse</string>
</array>
<key>CFBundleURLName</key>
<string>LocalCommand</string>
</dict>
</array>
---- the rest of the file stays like it was ---
Save the plist file, then double-click the script-application. Nothing should happen.
At this point it should already work in Safari. Try it out: playclipse://open?url=file:///Users/some-file-some-where&line=1
First close google chrome.
Now open the file ~/Library/Application Support/Google/Chrome/Local State
in
your favourite text editor.
Search for excluded_schemes
and add playclipse:false
, like so:
[...]
"nntp": true,
"playclipse": false,
[...]
Save the file. Launch google chrome, test it out. Everything should work now.
This wasn't easy enough, bang your head against the table 93 times!