Jump to content

iandol

Member
  • Posts

    166
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by iandol

  1. Hi this is very minor. Within /System/Library/CoreServices/Finder.app there are a set of "shortcut" apps that open the respective Finder features/locations:

     

    5a4ae7b55e84c_ScreenShot2018-01-02at09_58_34.thumb.png.b3c83d169a503be4afe64a081777f5d5.png

     

    It seems this would be a useful addition to the default search locations for Alfred, as it would add iCloud Drive, Recents and other "links" to the standard search results.

     

    /System/Library/CoreServices/Finder.app/Contents/Applications/

     

     

  2. On 20/12/2017 at 2:28 AM, vitor said:

    Update.


    Should now work with system ruby.


    To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

     

    Great (though in the meantime I made my own workflow that uses Pandoc with a custom Lua writer)! Out of curiosity and desire to learn, how did you get this to work?

     

    Thanks again for your excellent workflows!

  3. You can test this by modifying the findReferences.applescript if...end if block on line 9 to send some debugging output to the desktop:

     

    		if length of query is greater than 1 then --no point in searching for <=2 letter fragments
    			set AppleScript's text item delimiters to {return}
    			set searchString to "authors REGEX '(?i)" & query as string & "'"
    			set refList to text items of («event ToySSQLS» searchString)
    			do shell script "echo " & quoted form of (searchString as string) & " >> ~/Desktop/becite.txt"
    			do shell script "echo " & quoted form of (refList as string) & " >> ~/Desktop/becite.txt"
    			set AppleScript's text item delimiters to {","}
    		end if

     

    This shows the output for english names but not Chinese characters. If I remove the "if length..." check then the script blocks taking ages for searching each single character. The solution would be to check if this is a particular range of unicode, and if it was standard latin then enforce the length check, otherwise don't. but how one does that in Applescript I don't know, so one would have to do it in the shell? 

     

    If I set length to 0 then the script works:

     

    ?  osascript findReferences.applescript 王   
    {"items": [    
    
    {
    	"uid": "38685",
    	"arg": "38685",
    	"title": "王 2017",
    	"subtitle": "This is a test article",
    	"icon": {"path": "file.png"}
    }
    ]}

    So the issue really is to be able to check if the Alfred input is chinese or not in the Applescript. Any ideas welcome!

     

    EDIT: one way is to use the shell test command and check if the input is greater than a latin extended character (binary value of the string value is used): if [[ '王' > 'ž' ]] then; echo "YES!"; fi

  4. Hm, that's weird. Eggman's script (which I slightly modified) should work with english names (it does for me and I assume everyone else). The first line of the applescript converts the input from Alfred into UTF-8:

     

    set query to (do shell script "echo " & argv & " | iconv -s -f UTF-8-Mac -t UTF-8") as Unicode text

     

    and so it should work at input. Bookends should be UTF-8 aware, if you do a SQL search (⇧⌘S) directly in Bookends, it seems to work:

     

    Sample:  & 照山 (2017) “This is a test article” Neuron 23(4) p.1–5 

     

    SQL REGEX: authors REGEX '王'

     

    One potential problem is for speed I do not use single character search (if you search for "s" you basically block the applescript, which means chinese characters may never trigger the search...

  5. @Andrew — yes i can confirm that with ⌥SPACE Alfred works OK — however years of use of ⌘SPACE mean I do not function properly without ⌘SPACE :lol:

     

    I can only add to the voices that since I have started using macOS (~Panther), I face more stupid (and not so stupid) bugs than ever. But I'm with @deanishe in that they are still less bad than the alternatives (though the gap is diminishing, at least with windows; ubuntu 17.10 broke more things than 10.13 so the differential remains)...

     

  6. I tried in High Sierra with the system ruby, and see the same issue with the (ruby 2.3.3p222) there as well as rbenv; that a dynamically linked library libruby.2.4.2.dylib cannot be found:

    required dylib '/usr/local/opt/ruby/lib/libruby.2.4.2.dylib' not found, needed by '...Redcarpet/gems/redcarpet-3.4.0/lib/redcarpet.bundle'.  Did try: file not found '/usr/lib/libruby.2.4.2.dylib', file not found '/usr/local/lib/libruby.2.4.2.dylib', file not found '/usr/local/opt/ruby/lib/libruby.2.4.2.dylib'

    I don't think this is a ruby version issue, but that the redcarpet that you bundle has a specific dylib dependency that is not met. I have RedCarpet gem installed locally, but it does not get used by your workflow. I tried searching in my rbenv install for 2.4.2 and cannot find libruby.2.4.2.dylib anywhere. rbenv uses ruby-build to install a ruby from source and I don't know why this is different than the homebrewed ruby. I need to use rbenv for other things, so don't want to install a third copy of ruby with homebrew. I can stick to your old workflow.

     

    Anyway, thank you for all your excellent workflows!

  7. I've tried MerkdownTransform using Ruby V2.4.2p198 installed via rbenv and it fails (same error as if I use System Ruby 2.0.0p648 in Sierra):

     

    Starting debug for 'MarkdownTransform'
    
    [2017-11-27 23:42:37][trigger.hotkey] Processing output of 'action.script' with arg 'Here is a **test** text'
    [2017-11-27 23:42:38][ERROR: action.script] /Users/ian/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/ian/Dropbox/Assorted/Alfred Settings/Alfred.alfredpreferences/workflows/user.workflow.B3480116-6231-4778-AD34-B08AA40F9A5D/_licensed/Redcarpet/gems/redcarpet-3.4.0/lib/redcarpet.bundle, 9): Library not loaded: /usr/local/opt/ruby/lib/libruby.2.4.2.dylib (LoadError)
      Referenced from: /Users/ian/Dropbox/Assorted/Alfred Settings/Alfred.alfredpreferences/workflows/user.workflow.B3480116-6231-4778-AD34-B08AA40F9A5D/_licensed/Redcarpet/gems/redcarpet-3.4.0/lib/redcarpet.bundle
      Reason: image not found - /Users/ian/Dropbox/Assorted/Alfred Settings/Alfred.alfredpreferences/workflows/user.workflow.B3480116-6231-4778-AD34-B08AA40F9A5D/_licensed/Redcarpet/gems/redcarpet-3.4.0/lib/redcarpet.bundle
    	from /Users/ian/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    	from /Users/ian/Dropbox/Assorted/Alfred Settings/Alfred.alfredpreferences/workflows/user.workflow.B3480116-6231-4778-AD34-B08AA40F9A5D/_licensed/Redcarpet/gems/redcarpet-3.4.0/lib/redcarpet.rb:1:in `<top (required)>'
    	from /Users/ian/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    	from /Users/ian/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    	from ./bbcode:4:in `<main>'
    [2017-11-27 23:42:38][action.script] Processing output of 'output.clipboard' with arg ''
    [2017-11-27 23:42:38][output.clipboard] Processing output of 'action.script' with arg ''

     

    I can test on another machine with High Sierra and Ruby V2.3 tomorrow see if I also get the Library not loaded: /usr/local/opt/ruby/lib/libruby.2.4.2.dylib (LoadError) 

  8. karabiner_grabber is a root process which isn't unloaded when you force quit Karabiner, run as a KeepAlive daemon, so sudo killall -KILL won't work and I had to manually:

     

    sudo launchctl unload /Library/LaunchDaemons/org.pqrs.karabiner.karabiner_grabber.plist 

     

    but, though it is only a short time since I made sure karabiner wasn't running, I've still experienced one missed hotkey activation.I'll try to keep Console open and see if I can see anything in the system log when it happens next...

  9. Thanks Andrew, I've run for a day after exiting karabiner elements and bettertouchtool and I still see the same problem (less often, though note karabiner leaves a process, karabiner_grabber in memory even after exiting) I'm very well aware this is a non-reproducible bug and almost impossible for you to do much about. Is there a way to enable a debugging mode for Alfred, to see if anything gets spat out when the hotkey fails?

  10. Thank you @Andrew . I had no other input sources so no hotkey was assigned. I've now added a new input source and made sure that no input source hotkeys are not ⌘SPACE, then disabled them all (as specified in the instructions)

     

    I'll try to run with ⌥SPACE for a while, however my muscle memory is so locked to ⌘ I will often forget, if it seems OK, then I'll try going back to ⌘SPACE and see what the situation is.

     

    I do have karabiner elements installed, but only use it to transform CAPS LOCK to something more useful, and I also use BetterTouchTool, but there are no hotkey's assigned to ⌘SPACE, and anyway these apps both run on my laptop where I see no issue.

  11. I have a clear issue on one machine, whose reproducibility depends on *not* using Alfred for a while. On my iMac (magic keyboard2) I have my Alfred hotkey set to ⌘SPACE and if I do not use Alfred for 5-10minutes or more when I press the hotkey Alfred does NOT trigger. If I hit the hotkey a second time then it activates fine; then I dismiss Alfred, and I can trigger it reliably again. BUT if I start working on something and don't trigger Alfred for an amount of time (I haven't determined exactly how long, but it seems to be more than 5 minutes or so), then the first trigger fail happens again. I fixed it by rebooting for a while then it returned. I sync my Alfred settings via Dropbox to my laptop, which DOESN'T ever show this problem...

     

    I worried that the problem was physically with my [SPACE] key but I can trigger Spotlight reliably with ⌃SPACE before I try Alfred which fails, and SPACE never fails when I'm writing normally. I've tried using the second ⌘ key just in case the left key was a problem but I also see the same issue.

     

    The major difference between my iMac and laptop is I upgraded to 10.13.1 on my iMac where I still run 10.12 on my laptop. Both machines run Alfred V3.5.1 [883]

  12. This is for tool 7 (becite)? At the moment it takes the entry name and searches immediately, I'm not sure how to add a page number without interfering with the initial search. So I wonder whether I can add a (key modifier) trigger when you select an item to bring up Alfred again to enter the page number, I'll have a think about it over the weekend, any other ideas welcome :)

  13. Thanks deanishe, very neat idea, however my applescript can run for 3-5 minutes in the background so blocking Alfred for this time wouldn't be much use.

     

    I found this tool:

     

    https://github.com/tsntsumi/ProgressDialog

     

    However it uses "tell application" and I can't see how that would work if it is stored in the workflow bundle. So annoying Apple never made Applescript progress work for scripts...

×
×
  • Create New...