Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
This issue is at odds with
http://code.google.com/p/js-test-driver/issues/detail?id=97.
Original comment by corbinrs...@gmail.com
on 6 Jun 2012 at 12:25
The problem is, with the old system, people who wanted to use open -a still
could (via a wrapper script or whatever). With the new system, people who don't
want to use open -a have no choice.
Firefox and Chrome on mac support command line switches; issue 97 is re Safari,
because it doesn't. Given that that's the case, changing the startup behaviour
of Safari involves writing an applescript wrapper anyway, and adding open -a
just makes inserting this wrapper *harder*. eg, the behaviour below, closing
tabs in safari, can't be done without a wrapper (I do this in chrome by
starting the browser --incognito)
#!/bin/sh
# A selection of things you might want to do to Safari
# Close open instances
killall Safari
# clear the caches
rm -rf ~/Library/Caches/Safari/*
# Start it back up...
open -a Safari
# ...without any open tabs
osascript -e "tell application \"Safari\" to close every window"
# NOW capture the browser
osascript -e "tell application \"Safari\" to open location \"$1\""
Original comment by brian.ew...@gmail.com
on 6 Jun 2012 at 1:18
It's a damned if I do and damned if I don't.
Since I can't find much documentation on open, maybe you can answer this: can
open be used on apps outside /Applications?
Original comment by corbinrs...@gmail.com
on 6 Jun 2012 at 2:27
Yes, you can use the full path to the app directory (including the '.app'
extension). If anything, that's preferable.
As far as I can tell, open is a small wrapper around Apple's Launch Services.
https://developer.apple.com/library/mac/#documentation/Carbon/Reference/LaunchSe
rvicesReference/Reference/reference.html
The paths we're interested in always end up calling LSOpenURLsWithRole. This
takes a LSApplicationParameters reference, which includes an application's
filename. This filename comes from a call to LSFindApplicationForInfo. This
takes a bundle id and/or a filename to search for; my guess is open passes its
'-a' argument to both.
Original comment by brian.ew...@gmail.com
on 6 Jun 2012 at 3:46
Original issue reported on code.google.com by
brian.ew...@gmail.com
on 26 Apr 2012 at 12:51