• Content count

  • Joined

  • Last visited

  • Days Won


dfay last won the day on June 11

dfay had the most liked content!

1 Follower

About dfay

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Interests
    see also https://github.com/derickfay - assorted small projects related to Keynote, BibDesk, Alfred, Taskpaper & more
    http://dfay.fastmail.fm/et/ - using Editorial with TaskPaper files
    http://dfay.fastmail.fm/bibdesk/ - BibDesk scripts and templates
    and a blast from the past: http://dfay.fastmail.fm/wordperfect - WordPerfect on the Mac

Recent Profile Visitors

5,702 profile views
  1. While we're adding options to the Open functionality, there's also screen selection: I think this could be done with a couple of modifier keys and/or a preference (ideally per app) to open up functionality for those users who want it without confusing things too much.
  2. These were the directions I followed: https://yourmacguy.wordpress.com/2013/07/17/make-your-own-url-handler/ and here's the script that I used in the handler (complete with all my commented-out testing lines): on open location theURL -- set theURL to "sourceapp://x-callback-url/success?targetId=jsvEPFa6vvq3vDmrAt4KGA&targetURL=ulysses://x-callback-url/open?id%3DjsvEPFa6vvq3vDmrAt4KGA" -- display dialog theURL set x to the offset of "ulysses" in theURL set y to the offset of "?id%3D" in theURL -- display dialog y set theNewSheet to text from x to y of theURL & "id=" & text from (y + 6) to -1 of theURL -- display dialog theNewSheet tell application "BibDesk" set thePublications to the selection of document 1 repeat with thePub in thePublications add theNewSheet to thePub end repeat end tell end open location and here's the script for the workflow itself: tell application "BibDesk" activate -- without document, there is no selection, so nothing to do if (count of documents) = 0 then beep display dialog "No documents found." buttons {"•"} default button 1 giving up after 3 end if set thePublications to selection of document 1 repeat with thePub in thePublications export document 1 using template "exportMarkdown" to clipboard for thePub set Markdown_link to "" set CiteKey to cite key of item 1 of thePub set ItemURL to "x-bdsk://" & CiteKey -- set itemName to title of item i of thePub set theWikiLink to "[" & CiteKey & "]" & "(" & ItemURL & ")" set Markdown_link to (Markdown_link) & theWikiLink set theText to ("# " & (the clipboard) & Markdown_link) set theKeywords to get keywords of thePub as string set theKeywords to my replace_chars(theKeywords, " ", "_") set theHashtagKeywords to "#" & my replace_chars(theKeywords, ",_", " #") set theTemplate to " Date: " & my todayISOformat() & " Keywords: " & theHashtagKeywords set theCommand to quoted form of ("ulysses://x-callback-url/new-sheet?x-success=ulbd://x-callback-url/success&text=" & theText & theTemplate) do shell script "open " & theCommand end repeat end tell -- -- -- Helpers -- -- -- on todayISOformat() set theDate to current date set y to text -4 thru -1 of ("0000" & (year of theDate)) set m to text -2 thru -1 of ("00" & ((month of theDate) as integer)) set d to text -2 thru -1 of ("00" & (day of theDate)) return y & "-" & m & "-" & d end todayISOformat on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars Most of it's getting stuff ready in BibDesk but the line "set theCommand...." is the important one -- it sets the x-success to return a ulbd:// URL which is what the handler is registered for. It's kind of a kludge since it's really only designed for this one scenario, rather than processing the callback and doing different things with it but it should give the overall idea.
  3. Also - writing a callback handler in AppleScript and registering it is pretty easy - I have one that lets me create a new Ulysses sheet then pass the URL back to BibDesk to attach to a publication record , & I'm happy to share it and the links I used to figure it out if you're interested. I'd expect that Bear's URL scheme will eventually provide callback info & this may yet be an option.
  4. Look at the work Rob Walton (and I, in lesser capacities) have done with the Ulysses workflow : A lot of the challenges are similar - the solution there relies on parsing the library for some parts of the workflow and using the URL scheme for others. (Incidentally I was in the early Bear betas and ended up moving everything to Ulysses when I ran into the limits of hashtag-based organization--haven't looked back).
  5. Maybe this could be implemented at the same time, too....
  6. see There was another discussion recently re Spark in particular. Readdle hadn't built in any Applescript support, and if they repeat their approach to PDF Expert on the Mac, they won't in the future, unfortunately.
  7. If you want to do it through a native dialog rather than Alfred, just use AppleScript. This is an old reference but everything there should work: https://www.macobserver.com/tips/applescript/2001/20010917.shtml
  8. If you just did a fresh install, the problem might have been that Spotlight was still doing the initial indexing, which can take a while.
  9. "You could also have this work as you type by making a specific snippet for every possible pair of twin capitals. Doable, but that’s still over one thousand of them." Easily generated with a couple nested loops.... Now I want to try it just to see if it will break Alfred....
  10. I use them all the time with TE 5.1.4. Never upgraded to the subscription version but earlier ones (3 & 4 as well) have worked fine with Alfred 2 & 3.
  11. I haven't had these errors in sierra either, but when I've seen <<class pcap>> and that sort of thing, it's because an app has been deleted.... Did you have scripting additions previously and maybe not reinstall them with sierra? (or something else installed in a location that might have been overwritten during the install?).
  12. see https://www.engadget.com/2013/03/11/more-tips-for-troubleshooting-automator-workflows/
  13. https://www.alfredapp.com/help/workflows/inputs/file-filter/
  14. Just remember the immortal (actually three week old) words of Jason Snell, "nobody grades you on the scaffolding." From reading this thread, it really looks like you had an idea that worked with a few files but which cannot be made to scale. Why struggle with it when there are ready-made tools that can be easily adapted to do what you want? Have you looked at DevonThink?
  15. Basically it looks like you're trying to reinvent the wiki, and honestly I think you'd do much better to use an off-the-shelf solution like WIkidot, where all this infrastructure is taken care of for you and you can concentrate on content. Wikidot has a decent API & it would be pretty easy to build a workflow that queries it. Or you could use mediawiki & adapt the existing Wikipedia workflows.