-
Posts
166 -
Joined
-
Last visited
-
Days Won
7
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by iandol
-
-
@vitor ...yes, Pandoc cannot be easily bundled: it is ~100MB, and for generic BBCode conversion would be pure overkill!!! But I use it for all my writing (triggered via Scrivener 3) and it is incredibly powerful for multiple output formats, so it was easy to make a personal workflow with a custom Lua writer with it.
Thanks for the technical details on the fix!
-
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!
-
OK I think it is fixed (Github update V1.0.8), at least it now works on your library. I've also improved the code so that it searches the author OR editor field as I saw quite a few of your refs have editors but no authors...
-
Can you create a small bookends database (20 refs), and attach it here so I can test? I can't see why Eggman's script works but mine doesn't, and it is working with my database...
-
Try to redownload the workflow from github, I made a V1.0.7 which is at least working on my test reference:
-
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
-
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...
-
On 30/11/2017 at 11:33 PM, Steve Ball said:
Perhaps a full HD-wiping OS install would fix it (not that I want to do that).
No, my 10.13 install was a clean rebuild from scratch (manual transfer of Library files, reinstall of apps denovo etc.) so full wipe will not solve anything...
-
@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
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)...
-
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!
-
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)
-
No problems if there is no update, no problem with the path — could you tell us the minimum required Ruby version (RedCarpet only needs 1.9.2)?
-
Thanks vitor, would you be willing to make a generic path workflow variable we could edit so that we didn't lose the path every new new version?
-
Hi vitor, perhaps I'm being blind but I cannot see what the actual version of Ruby is needed for this? Also, it would be great if you could add rbenv installed ruby support, you need to add: $HOME/.rbenv/shims/ to the path and then it should work (i have 2.4.2 installed via rbenv, 2.3.3 system ruby).
-
That was easy , new tool is called betitle in V1.0.6, does a case insensitive search (needs to be > 2 characters) within the title field. I have ~3800 references and it searches quickly even when it returns around 30 or 40 search hits to populate the Alfred results list…
-
Accessibility: Alfred 3.app — Alfred Text Service.app — BetterTouchTool.app — Dropbox
-
@Steve Ball: do you have any other software that can control the keyboard installed (like bettertouchtool/karabiner etc.)?
I have had console open several times when this happened and didn't see anything in system log to give a clue as to what could be happening...
-
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...
-
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?
-
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.
-
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]
-
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
-
1 hour ago, deanishe said:
It doesn't block Alfred. Your long-running script should write its progress to a file, and a separate Script Filter then reads the file and shows the progress bar. You can open and close it as you please.
Woah, that is super cool. Will give it a go thanks!!!
-
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...
Add Finder shortcut app folder to default search locations
in Alfred Feature Suggestions
Posted · Edited by iandol
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:
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.