Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    62

Posts posted by dfay

  1. Here is a counterpart to the above workflow, to search the Skim notes of the currently open file.

     

    https://dl.dropboxusercontent.com/u/6601556/Alfred/Search Skim Notes (Active Document).alfredworkflow

     

    Skim's bookmarks are by page rather than by text, so they are not searchable directly but it would be easy to designate a note type and style that you only use for bookmarking (e.g. red highlights) and then limit the search accordingly to make a version that would just search them.

  2. For future reference to anyone interested, here's how I solved this problem in AppleScript, in this case to run different Chronosync documents per machine.  (In addition, I have a post-run script set up in Chronosync that updates a file in Dropbox indicating which machine the sync last ran on, and a Script Filter in Alfred that displays this status as a subtitle - can post if anyone's interested).  

     

    set theComp to computer name of (system info)
    	tell application "ChronoSync"
    		if theComp contains "MBA" then
    			open "/Users/username/Documents/archive/MBA to MyUSBStick.sync"
    		else if theComp contains "iMac - work" then
    			open "/Users/username/Documents/ChronoSync Documents/MyUSBStick Documents <> iMac - work.sync"
    		else if theComp contains "MBP" then
    			open "/Users/username/Documents/archive/MBP to MyUSBStick.sync"
    		else if theComp contains "Mac Mini" then
    			open "/Users/username/Documents/ChronoSync Documents/Mac Mini to MyUSBStick.sync"
    		end if
    		Trial Sync document 1
    	end tell

     

  3. You can create a workflow to search Skim notes and open the corresponding PDF from Alfred quite easily...just tried it:

     

    1) create a file filter for Skim notes (see link above on creating file filters)

    2) connect 1) to a Replace action & replace skim with pdf

    3) connect 2) to a File Open action

     

    Here: https://www.dropbox.com/s/yjeurvlbhhd1aum/Simple Skim Notes Search.alfredworkflow?dl=0

     

    2016-12-11 edit: you will probably also want to add kMDItemTextContent in the Advanced tab so that Alfred is searching the full text of the Skim notes.

  4. I just looked at the metadata on an existing pdf (using mdls , the command-line program to access Spotlight metadata) then added a bookmark in Preview to that PDF, and looked at the metadata again.

     

    The bad news is that Preview isn't saving the Bookmarks as metadata - they're encoded directly in the PDF....so you would need to use a tool like pdftk to read the bookmarks ... but you don't want to do that for each file each time you search....so you'd need to cache it....

     

    The other option is to use Skim and have it save separate skim notes files - this won't save bookmarks per se but it will create searchable files with all your annotations -- see http://apple.stackexchange.com/questions/41013/is-there-a-way-spotlight-indexes-my-skim-bookmarks-notes. (There's also a preference in Skim to make it create the Skim notes files by default).

     

    Having said that I've got a library of +/- 8000 PDFs and in 12 years with Skim I don't think I've ever searched my annotations directly -- they all end up in a BibDesk database and I search the accompanying bibliographical records instead.  BibDesk allows the option to search within Skim notes (same developers), which works great on the rare occasions when I need it.

     

    The pain with Skim is that if you're round-tripping to iOS you need to regularly be converting Skim notes to standard PDF annotations and vice versa.  (This actually has got me thinking about dropping Skim, but there's nothing else I've found that is as customizable or scriptable.  Even though @smarg19's Skimmer workflow hasn't been updated in ages....).  If someone could write a cross-platform PDF editor that has a URL scheme that allows linking and indexing of annotations on iOS and MacOS I'd buy it in a second.

     

    Following-up - it looks like the developers of Skim and BibDesk have ruled out searching standard (i.e. non-Skim) PDF annotations precisely because they are not included in metadata - see https://sourceforge.net/p/bibdesk/feature-requests/760/

     

     

  5. I'm not thinking app detection but actually being able to have a custom touch bar to go with a particular Alfred workflow - right now I have a workflow that searches BibDesk and does different things with the result based on no modifier, shift, command, control, and alt/option keys held.  Right now I need to hold each key to see the reminder for which each one does (and I've run out of modifier keys).  I'd love to stick all those actions up on the touch bar.

  6. For Safari 10 you need to change the AppleScript so that "Details..." reads "Manage Website Data…"

     

    Here's the full script:

     

    set theWebsite to "{query}"
    tell application "Safari" to activate
    delay 2
    tell application "System Events" to tell process "Safari"
    	keystroke "," using command down
    	delay 2
    	tell window 1
    		click button "Privacy" of tool bar 1
    		delay 5
    		click button "Manage Website Data…" of group 1 of group 1
    		delay 2
    		keystroke theWebsite
    		delay 1
    		keystroke tab
    		delay 1
    		keystroke "a" using command down
    		click button "Remove" of sheet 1
    		click button "Done" of sheet 1
    	end tell
    	keystroke "w" using command down
    end tell

     

×
×
  • Create New...