Hi, It is very cool that enter now opens URLs in textmate.
It would be a nice addition if, as in Safari and mail.app, adding a modifier opened the URL without bringing the browser to the front-most.
So, I suggest "Cmd-ENTER" = open in browser in background
tim
On 27. Oct 2006, at 18:00, Timothy Bates wrote:
It is very cool that enter now opens URLs in textmate.
Actually, this feature has existed for a year or so ;) just felt like mentioning in the release notes, as it’s not directly visible.
It would be a nice addition if, as in Safari and mail.app, adding a modifier opened the URL without bringing the browser to the front-most.
The problem is that there is no API for that.
It is very cool that enter now opens URLs in textmate.
Actually, this feature has existed for a year or so ;) just felt like mentioning in the release notes, as it¹s not directly visible.
So much goodness... So hard to find...
It would be a nice addition if, as in Safari and mail.app cmd-enter opened the URL without bringing the browser to the front-most.
The problem is that there is no API for that.
AppleScript does this for you without activating the application
tell application "WebKit" --activate --commented out to show the difference open "www.psy.ed.ac.uk" end tell
So that's one solution - I bet it is what mail.app uses. We could tell by snooping on apple events
On 28. Oct 2006, at 16:41, Timothy Bates wrote:
The problem is that there is no API for that.
AppleScript does this for you without activating the application
tell application "WebKit" --activate --commented out to show the difference open "www.psy.ed.ac.uk" end tell
So that's one solution - I bet it is what mail.app uses. We could tell by snooping on apple events
Mail has this feature?
As for the AppleScript, for me both Safari and OmniWeb opens the string as file://…
So that's one solution - I bet it is what mail.app uses. We could tell by snooping on apple events
Mail has this feature?
Yes. Try cmd clicking a link in an link in an email. It opens in the background, which is very handy. However, I see that it also obeys the app pref to open in a new tab in the existing window if one exists.
As for the AppleScript, for me both Safari and OmniWeb opens the string as file://
My fault for a quick example - the key is that it opens it as file without activating the browser.
Working example =
tell application "WebKit" set theUrl to "http://www.psy.ed.ac.uk" make new document at end of documents set the URL of document 1 to theUrl end tell
But, that needs a new window, not the user's preferred setting (choice of new tab or new window).
The standard additions contain the command "open location" which opens a url but also activates the called app...
On 10/28/06, Allan Odgaard throw-away-1@macromates.com wrote:
As for the AppleScript, for me both Safari and OmniWeb opens the string as file://…
You should use "open location" instead of "open". It opens the link in the default browser and respect the "open in tab' pref. But the browser is activated.
Although not perfect, this works: open location "http://macromates.com" tell application "TextMate" to activate
On Oct 28, 2006, at 07:46, Allan Odgaard wrote:
On 28. Oct 2006, at 16:41, Timothy Bates wrote:
The problem is that there is no API for that.
AppleScript does this for you without activating the application
tell application "WebKit" --activate --commented out to show the difference open "www.psy.ed.ac.uk" end tell
So that's one solution - I bet it is what mail.app uses. We could tell by snooping on apple events
Mail has this feature?
So does NetNewsWire Lite, IIRC. I believe you can do it in code with LSOpenFromURLSpec using the appropriate launch flags, unless you require a scripting solution.
Adam
Adam R. Maxwell wrote:
So does NetNewsWire Lite, IIRC. I believe you can do it in code with LSOpenFromURLSpec using the appropriate launch flags, unless you require a scripting solution.
Hmm. And now we're all sorry that Apple doesn't ship machines with python 2.5 / PyObjC yet. Once they do, this sort of thing will be easy to do from python. For now, I think we'd have to make a separate compiled C app to open URLs.