Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by dfay

  1. I am working on a workflow that lists all installed hotkeys by parsing the .plists for installed workflows.  It can be found here: http://www.alfredforum.com/topic/4384-workflow-picker/?p=26471 and the specific file that's causing me problems is list_hotkeys.py .  

     

    Everything worked fine until I installed a new version of one of my other workflows (Case Hotkeys) -- it would show all the installed hotkeys as expected.

     

    After updating the other workflow, its hotkeys no longer appear.  And if I run the script from the terminal, they do not appear in the output.  There are no error messages in the Alfred debugger, and all the other hotkeys still appear, just not the ones from the newly updated workflow.

     

    But if I go into the python interpreter and manually execute the code, it will read the .plist in question correctly, and I can see that all the properties that should lead it to be included are there.

     

    So I am puzzled.  Just to double-check, I installed the latest version of the Mavericks Tags workflow ( http://www.alfredforum.com/topic/3383-mavericks-tags-file-and-email-tagging-with-alfred-2-updated-to-v14/ ), which used to appear, and now my script can't find the hotkeys for that workflow either.

     

    Any suggestions?

  2. Yeah, it's reading your .plist correctly but it seems there's no 'categories' key in your plist.  This probably means you haven't created any.

     

    I just posted an updated version which should handle this situation and just default to All.

  3. This is odd, b/c it means the script has successfully read your prefs in ~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences.plist (which aren't synced) and found the syncfolder key therein.  And the path that is created looks correct.

     

    Looking in the ....Alfred.alfredpreferences/preferences/workflows/prefs.plist file, the only thing that is in there is the list of categories.

     

    Two questions for you:

     

    - are you running Alfred 2.2 or later?  This is the version that introduced categories, and the file may not exist in prior versions.

    - have you placed any workflows into categories?  It may be the case that Alfred only creates the file if new categories are created, not by default.

  4. Workflow Picker

     

    Newly updated to work with Alfred 3

     

    Select from Installed Workflows

     

    I have more workflows and associated keywords and script filters than I can remember. Rather than going into Alfred’s Preferences, I wanted a quick way to see the keywords & script filters available in the workflows I have installed, (optionally) grouped by the categories that have been available since Alfred 2.2. Inspired by Shawn Rice’s Workflow Help workflow and deanishe’s Appscript workflow, I put this together.

     

    There are five keywords:

    • wfa - List all installed keywords/script filters
    • wfp - Select a category to list keywords/script filters
    • wfc - List keywords/script filters within a category alphabetically
    • wfg - List keywords/script filters within a category, grouped by workflow
    • hot - List all hotkeys (this does not execute the hotkey - it’s just a way of seeing them all, and potential hotkeys which have no key assigned)

     

    By default, wfp outputs to an Applescript which calls wfc on the selected category. This can easily be changed in the workflow layout in Alfred Preferences to call wfg instead.

     

    Alfred 3 compatible version hosted at

    https://www.dropbox.com/s/14sxodqbyoqa74n/Workflow Picker 3.alfredworkflow?dl=0

     

    Details to manually update for Alfred 4 are further along in this thread....

     

    Version History:

    • 2014–05–13: initial release
    • 2014–05–15: 1.01 updated to make sure prefs.plist file with categories exists
    • 2014–05–15: 1.02 added wfa, updated prompts
    • 2014-05-20: 1.03 added hot
    • 2014-05-22: 1.04 updated to make afp and hot filter by query
    • 2016-05-20: 3.0 updated for Alfred 3

     

  5. Hi Stephen....nice to see your automation work continuing (I had given you some feedback on the Skim / Markdown citation scripts last fall).

     

    Unfortunately I am also getting errors with this - as soon as I start typing a query, I get the message 

     

    Error in workflow 'com.hackademic.bibquery'

    days=-1259767745; must have magnitude <= 999999999

     

    Here is the full error log from Alfred - I didn't get a chance to look much into it but it looks like the error is coming from one of the libraries you're using, not your code itself.

    [ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:06:18 workflow.py:1199 ERROR    days=-1259767745; must have magnitude <= 999999999
    Traceback (most recent call last):
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/workflow/workflow.py", line 1197, in run
        func(self)
      File "bibquery.py", line 442, in main
        filter(queries, scope, wf)
      File "bibquery.py", line 420, in filter
        simple_filter(query, scope, wf)
      File "bibquery.py", line 310, in simple_filter
        data = read_cachedir()
      File "bibquery.py", line 83, in read_cachedir
        bib_data = ccl_bplist.load(_file)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 271, in load
        return __decode_object(f, offset_table[top_level_object_index], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 245, in __decode_object
        val = __decode_object(f, offset_table[value_refs[i]], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 126, in __decode_object
        return datetime.datetime(2001,1,1) + datetime.timedelta(seconds = date_value)
    OverflowError: days=-1259767745; must have magnitude <= 999999999
    [ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:06:19 workflow.py:1199 ERROR    days=-1259767745; must have magnitude <= 999999999
    Traceback (most recent call last):
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/workflow/workflow.py", line 1197, in run
        func(self)
      File "bibquery.py", line 442, in main
        filter(queries, scope, wf)
      File "bibquery.py", line 420, in filter
        simple_filter(query, scope, wf)
      File "bibquery.py", line 310, in simple_filter
        data = read_cachedir()
      File "bibquery.py", line 83, in read_cachedir
        bib_data = ccl_bplist.load(_file)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 271, in load
        return __decode_object(f, offset_table[top_level_object_index], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 245, in __decode_object
        val = __decode_object(f, offset_table[value_refs[i]], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 126, in __decode_object
        return datetime.datetime(2001,1,1) + datetime.timedelta(seconds = date_value)
    OverflowError: days=-1259767745; must have magnitude <= 999999999
    [ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:06:19 workflow.py:1199 ERROR    days=-1259767745; must have magnitude <= 999999999
    Traceback (most recent call last):
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/workflow/workflow.py", line 1197, in run
        func(self)
      File "bibquery.py", line 442, in main
        filter(queries, scope, wf)
      File "bibquery.py", line 420, in filter
        simple_filter(query, scope, wf)
      File "bibquery.py", line 310, in simple_filter
        data = read_cachedir()
      File "bibquery.py", line 83, in read_cachedir
        bib_data = ccl_bplist.load(_file)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 271, in load
        return __decode_object(f, offset_table[top_level_object_index], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 245, in __decode_object
        val = __decode_object(f, offset_table[value_refs[i]], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 126, in __decode_object
        return datetime.datetime(2001,1,1) + datetime.timedelta(seconds = date_value)
    OverflowError: days=-1259767745; must have magnitude <= 999999999
    [ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:06:20 workflow.py:1199 ERROR    days=-1259767745; must have magnitude <= 999999999
    Traceback (most recent call last):
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/workflow/workflow.py", line 1197, in run
        func(self)
      File "bibquery.py", line 442, in main
        filter(queries, scope, wf)
      File "bibquery.py", line 420, in filter
        simple_filter(query, scope, wf)
      File "bibquery.py", line 310, in simple_filter
        data = read_cachedir()
      File "bibquery.py", line 83, in read_cachedir
        bib_data = ccl_bplist.load(_file)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 271, in load
        return __decode_object(f, offset_table[top_level_object_index], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 245, in __decode_object
        val = __decode_object(f, offset_table[value_refs[i]], collection_offset_size, offset_table)
      File "/Users/username/Dropbox/Sync/alfred/alfred.alfredpreferences/workflows/user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/ccl_bplist.py", line 126, in __decode_object
        return datetime.datetime(2001,1,1) + datetime.timedelta(seconds = date_value)
    OverflowError: days=-1259767745; must have magnitude <= 999999999
    
  6. I am getting the error intermittently still...some files with spaces work perfectly, others give the "Finder got an error: Handler can\U2019t handle objects of this class." message.  I'm puzzled.  I'll see if I can figure out what is making the difference.

     

    Thanks for all your work on this.

  7. I had spent a bit of time putting my 50 or so workflows into a mix of the default categories and 4-5 custom categories.

     

    I just updated Alfred to 2.3 (264).

     

    All of the workflows that were in one of the default categories are still categorized.  All of the others are now "uncategorised." 

     

    (also Alfred is using British English spelling of categorize :) )

  8. Also....if I uncomment the display dialog on line 5, cmd+return displays the correct file but the spaces are escaped with %20.

     

    in Applescript Editor, this works:

     

    set f to "Dragonfly:Users:somebody:Documents:unruh 2014 evidencing the resti.pdf"

    tell application "Finder" to reveal f

     

    but this
     
    set f to "Dragonfly:Users:somebody:Documents:unruh%202014%20evidencing%20the%20resti.pdf"
    tell application "Finder" to reveal f
     
    gives the same error message.
  9. Thanks - I have the latest pre-release.

     

    Here's what I see

     

    - [return] to open in Bibdesk

     

    works fine, but the debugger displays a message:

     

    [ERROR: alfred.workflow.input.scriptfilter] Code 1: Exited with error code but no message

     

     

    - [cmd]+[return] to reveal attached pdf in finder

     

    doesn't work, debugger says

     

    [ERROR: alfred.workflow.action.applescript] {

        NSAppleScriptErrorAppName = Finder;

        NSAppleScriptErrorBriefMessage = "Handler can\U2019t handle objects of this class.";

        NSAppleScriptErrorMessage = "Finder got an error: Handler can\U2019t handle objects of this class.";

        NSAppleScriptErrorNumber = "-10010";

        NSAppleScriptErrorRange = "NSRange: {230, 14}";

    }

     

     

    - [alt]+[return] to open attached pdf in your favorite viewer

     

    works fine, but the debugger displays a message:

     

    [ERROR: alfred.workflow.input.scriptfilter] Code 1: Exited with error code but no message

     

     

    - [shift]+[return] to copy the citekey to clipboard 

     

    works fine, but the debugger displays a message:

     

    [ERROR: alfred.workflow.input.scriptfilter] Code 1: Exited with error code but no message

     

     

    - [ctrl]+[return] to copy a citation string

     

    works fine, but the debugger displays a message:

     

    [ERROR: alfred.workflow.input.scriptfilter] Code 1: Exited with error code but no message

     

     

     

    In fact, on trying this a few times, the Code 1 error message is coming before I hit any of the modifier keys.  Which would make sense since it refers to the script filer.

  10. Hmm...I installed this and now Alfred displays the message

     

    Incompatible Workflow

    This workflow was created with a newer version of Alfred

    Please upgrade Alfred to the latest version (or pre-release) to use this workflow

     

    I am running Alfred 2.2 b243 which is the newest....I can't find a link to download a newer Alfred beta.

     

    The old version seems to be active, though, or the new one has issues - return, shift and alt options work; cmd and ctrl don't.

  11. The path isn't the issue.  The error message in the copy to clipboard script is because there's a hard-coded template name "abbrvTemplate" which isn't one of the BibDesk defaults.  

    set theResult to (templated text using "abbrvTemplate" for thePub)
    
    

    When I change that to a text template (Jim Harrison's "plainTemplateNonNumbered" that comes with CiteInPages) that I have installed on my machine it works.

     

    Not sure what's up with the reveal in Finder script.

  12. The readme doesn't actually match the commands in the workflow.  The actual commands are, if I read correctly:

     

    - [return] to open in Bibdesk

    - [ctrl]+[return] to copy the citation to the clipboard

    - [alt]+[return] to open an attached pdf in your favorite viewer

    - [shift]+[return] to copy a citation string ("abbrvTemplate")

    - [command]+[return] to reveal linked file in Finder

     

    But at this point, besides return, only alt-return and shift-return work - these both rely on bash scripts.  The other two rely on Applescripts which don't work on my machine.

×
×
  • Create New...