roadrunnertwice: DTWOF's Lois in drag. Dialogue: "Dude, just rub a little Castrol 30 weight into it. Works for me." (Castrol (Lois))
[personal profile] roadrunnertwice
I got annoyed at something earlier today and decided to fix it, and FastScripts was once again the first tool I reached for, so I decided to finally shell out for it.

For the curious: I got sick of downloading PDFs I only intend to read once and then having them clog up the downloads folder, and I wanted a command to trash the file right from the PDF reader. (Preview isn't scriptable, of course, but you should be using Skim anyway.)

tell application "Skim"

set current_file to file of document of window 1

tell window 1 to close

tell application "Finder" to delete current_file

end tell

Nice!

Date: 2012-05-25 01:47 am (UTC)
From: [personal profile] nadreck
Seems like a nice, fast script there.

As far as Preview not being scriptable: it adds a lot of its functions to Automator, but isn't technically scriptable itself. That said, any command that would qualify as an "Apple Event" (ie, open, close, switch to window, etc) is supposed to work whether the rest of the app is scriptable or not.

Profile

roadrunnertwice: Yrs truly surrounded by trees. (Default)
Nick Eff

October 2017

S M T W T F S
1 23 4567
891011 121314
15 161718192021
22232425262728
293031    

Expand Cut Tags

No cut tags

Most Popular Tags

Static and Noise

If you pass the rabid child, say "hammer down" for me.

The Fell Types are digitally reproduced by Igino Marini.

Style Credit