you could write a script to use to open documents in your application, something like this:
Shamelessly stolen from Bill Cheesman:
set theApplication to choose application as alias
set theFile to choose file
tell application "Finder"
” do your own stuff here with the file
open theFile using theApplication
end tell
You could similarily use a script to close the document (frontmost preferably)
Just look away from the triggering, but use something like quicksilver or fastscripts to overshadow the keys you use to open and close documents with, in that application.
@McUsr: That’s handy (thanks for the shamelessness). But I’m hoping for something that will work automatically when opening from the Finder, as explained below.
@Hans-Gerd Classen: The app is Skim (my default pdf reader/annotator). I’m looking for a way, when opening a file by double-clicking in Finder to automatically and immediately (in Skim parlance) “unembed” annotations.
Skim offers two ways to unembed: 1) File:Convert (also AS-able) and 2) via the skimpdf command line tool (/Applications/Skim.app/Contents/SharedSupport/skimpdf unembed ) for a file that is not open.
So, as it stands, when I double-click to open a file, to unembed any embedded notes, I have to either
File:Convert,
call an AS such as
which I call via a Fastscript shortcut.
or
before the file opens, use skimpdf either directly in shell or indirectly from an AS.
But I don’t see how to invoke any of these automatically in response to a double-click to open a file.
Actually, there is a way to intercept it, if you are willing…
You install RCDefaultApp preference pane http://www.rubicode.com/Software/RCDefaultApp/, then you write a little background application, that has an on open handler, that does the stuff for you, or tells Skim to do it, and anyways, passes the file over to Skim, done, or with instructions.