Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    62

Everything posted by dfay

  1. haha no worries @derBingle - there is also this which I'm sure is overkill for most users including myself
  2. Or bash & perl, or python
  3. I've run into this issue as well, and don't have a ready solution. I think any kind of automated sync / merge would probably not be worth the effort to build (for me at least) b/c the # of use cases are so few and the modifications I have made usually only take 5-10 minutes to replicate. Fortunately most of the workflows I've modified have been fairly stable (or to put it less kindly, abandoned by the authors) so I haven't run into it lately.... One thing which might help would be an option to "Update as Copy" vs. "Update Existing Workflow" i.e. to have the option to create a new instance of the workflow which could then be manually compared to the old modified version.
  4. Also, if you're using any older workflows that haven't been updated, you will need to change any AppleScript references from "Alfred 2" to "Alfred 3". But this is a matter for the workflow developers, not a native Alfred issue.
  5. Just to second what Vero said, having done a lot of UI scripting in AppleScript, I would only use it as an absolute last resort...
  6. https://www.alfredforum.com/topic/9662-ulysses-workflow/#comment-48350
  7. I use BTT but it doesn't give you per workflow customization with Alfred.
  8. 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.
  9. 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.
  10. 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.
  11. 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).
  12. Maybe this could be implemented at the same time, too....
  13. 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.
  14. 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
  15. 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.
  16. "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....
  17. 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.
  18. 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?).
  19. see https://www.engadget.com/2013/03/11/more-tips-for-troubleshooting-automator-workflows/
  20. https://www.alfredapp.com/help/workflows/inputs/file-filter/
  21. 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?
  22. 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.
×
×
  • Create New...