|
|
A better way (soon)
I'm working on a replacement for 'open', to be called 'launch'. The help message may give you some idea of what it does (most of the functionality is there now, I just need to rearrange things so it opens by default, add a couple of features, and I'll release it):
[p6:1] ~%FindApp 4:24PM
usage: FindApp [-opsbmhCX] [-c creator] [-i bundleID] [-u URL] [-n name] [document ...]
or: FindApp [-oplsbmhCX] item ...
-o attempt to launch target(s) instead of printing paths/URLs
-p print document(s) instead of opening them
-l launch URLs (e.g. treat http:// URLs as Web sites, not WebDAV)
-s launch target(s) as superuser (authenticating if needed)
-w wait for application to finish opening before exiting
-b launch application in the background
-m launch application again, even if already running
-h hide application once it's finished opening
-C force CFM Carbon application to launch in Classic
-X don't start Classic for this app if Classic isn't running
-c creator match application by four-character creator code ('ToyS')
-i bundle ID match application by bundle identifier (com.apple.scripteditor)
-u URL open item with file:// URL (NOT RECOMMENDED for scripts)
-n name match application by name (NOT RECOMMENDED, very fragile)
'document' may be a file, folder, or disk - whatever the application can open.
'item' may be a file, folder, disk, or URL.
Some examples:
[p6:4] ~%FindApp -i com.barebones.BBEdit 4:26PM /Volumes/GrayApps/Applications/BBEdit 6.1.2/BBEdit for OS X [p6:5] ~%FindApp -c 'R*ch' 4:28PM /Volumes/GrayApps/Applications/BBEdit 6.1.2/BBEdit for OS X [p6:6] ~%FindApp -n 'Disk Copy' 4:28PM /Applications/Utilities/Disk Copy.appHere's an example of how to use it as a script to launch BBEdit (pre 6.5).
[p6:3] ~%which bbedit 4:26PM
bbedit () {
for f
do
if [[ ! -f $f ]]
then
echo "n" > $f
fi
done
FindApp -oi com.barebones.BBEdit $@ 2> /dev/null
}
Using bundle identifiers (i.e. com.barebones.BBEdit) is a nice, human-readable way to specify applications compared to creator code, and it's robust if the application changes its name (modulo some LaunchServices bugs that I've reported to Apple...).
Released! (sort of)
I've released an alpha version of launch for testing, please download |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.13 seconds |
|