Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    62

Everything posted by dfay

  1. this looks like a candidate for a list filter: https://www.alfredapp.com/help/workflows/inputs/list-filter/
  2. You need to add one of the metadata keys -- I think it's kmdItemContent -- in order for file filters to search contents. I just use Spotlight if I need to search within a file -- I used to have Alfred set to search all file contents (not the default) but turned it off a couple of years ago b/c I realized I wasn't using Alfred primarily to search documents, but to launch apps and workflows etc. But I have also accumulated documents in so many different formats over the years that in practice I rarely want to restrict file type. I think for most users Alfred is not a Spotlight replacement but a complement, adding a ton of capabilities on top of the same index that Spotlight uses.
  3. https://www.alfredapp.com/help/workflows/inputs/file-filter/ lets you set up a dedicated filter for a particular file type.
  4. dfay

    Workflows API

    Haha I love that the first thing you learn is how to create an infinite loop! Great work as always.
  5. This problem is b/c smargh's Applescript action_pdf-splitter.scpt in the workflow bundle calls /System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py , an embedded script in one of the stock Automator actions. Unfortunately this Automator action doesn't seem to work in El Cap. if you open action_pdf-splitter.scpt in Script Editor and comment out the line -- tell application "Finder" to delete (every item of (cache_path as alias)) you can look in the workflow cache directory ~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.skimmer and you'll find the PDFs for individual pages there. You can then combine them in Preview or using Automator's New PDF from Images action * on further testing the script in the Combine PDF Automator action works fine with most PDFs, just not the ones generated by the Skim Applescript. But the New PDF from Images action works. Go figure. I edited the (*HANDLERS*) section of the script as shown below: on combinePDFPages(_title, cache_path, temp_path, orig_path) --convert AS paths to POSIX paths set orig_posix to (POSIX path of (orig_path as alias)) as string set temp_posix to (POSIX path of (temp_path as alias)) as string --prepare final PDF file path set _file to orig_posix & _title & "_split.pdf" (* --combine ALL individual PDF pages into new, single PDF do shell script "\"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py\" -o " & (quoted form of POSIX path of _file) & space & (quoted form of temp_posix) & "*.pdf" --delete the individual page PDFs tell application "Finder" to delete (every item of (cache_path as alias)) --open new PDF set _file_ to ((POSIX file _file) as alias) tell application "Skim" open _file_ go front document to page 1 of front document end tell *) tell application "Finder" to open (cache_path as alias) end combinePDFPages basically replacing the actual combining of PDFs with opening a Finder window to the folder where all the individual pages are stored. I use this infrequently enough that I'll just proceed manually from there.
  6. You can use Applescript to test which machine a workflow is running on, and alter workflow behavior on that basis. e.g. here is one I use with Chronosync, where the CS files have different names based on the machine: set theComp to computer name of (system info) tell application "ChronoSync" if theComp contains "laptop" then open "~/archive/laptop to USB.sync" else if theComp contains "home desktop" then open "~/Documents/ChronoSync Documents/home <> USB.sync" else if theComp contains "work desktop" then open "~/archive/atu-childermas.sync" else if theComp contains "another computer" then open "~/ChronoSync Documents/another cs doc.sync" end if Trial Sync document 1 end tell Also - in this example - I have a post-synchronization script set up in Chronosync which writes the date & time to a dotfile in Dropbox which my Alfred workflow reads in a script filter, so it comes up with the title "Chronosync Current Machine" and a subtitle like "Last run on Work Desktop, 2016-06-24 3:50 PM" Basically writing a dotfile to save the last run date instead of saving it as a variable within the workflow, and to make it available easily to scripts that aren't part of the workflow.
  7. Here's a more detailed description of how to set this up - this still relies on the clipboard but it doesn't affect clipboard history, and allows to select text and hit a hotkey rather than going through the manual steps you describe: create a new blank workflow add a hotkey, and select Action: Pass through to workflow and Argument: Selection in OS X add a run script action with the following config set in the dropdowns: Language: /bin/bash with input as argv for the script you can use query=$1 echo -n "<strong>"$query"</strong>" Then add a Copy to Clipboard action with {query} in the text box and both checkboxes below checked. then connect them all and add your hotkey
  8. a useful resource appeared today: https://www.smashingmagazine.com/2016/06/improving-ux-for-color-blind-users/
  9. create a trigger that connects to the following applescript: tell application "iTunes" set loved of current track to true end tell This didn't used to work with Apple Music, but it does now. Adding an Apple Music track throws up error "iTunes got an error: current track doesn’t understand the “add” message." number -1708 from current track So that's not easily possible at the moment.
  10. Another simpler if quirky option is to just give all the workflows the same name, then when they all show up in Alfred's results, use the command-number keys to select. I currently have seven different keywords named bib for various BibDesk and citation scripts, & this works fine for me. I suppose you could do this now by just typing 10k and using command-number as your submenu.
  11. TE import is discussed here: http://www.alfredforum.com/topic/8883-import-textexpander-snippets-into-alfred-v3/ and available as a web app here: http://alfred.danieldiekmeier.de
  12. You should use a Run Script object instead of Terminal Command. Alternatively you can do this without a workflow at all using a snippet with dynamic placeholders - see https://www.alfredapp.com/help/features/clipboard/dynamic-placeholders/
  13. That should be really easy. Follow the directions here to get the OS X .plist with the substitutions https://support.apple.com/en-us/HT204006, then convert the .plist from XML to Alfred JSON format.
  14. Hi strajk This should do what you want: https://github.com/derickfay/import-alfred-snippets I've only tested it with the sample text you provided above (with the spaces outside the quotes removed) and it worked fine.
  15. Thanks Vero and Frozen - great point Frozen re: the unfortunate state of iOS keyboards, too. I think for now a wait-and-see approach is prob. best, too.
  16. This forum has seen a lot of posts recently (including my own) which are basically geared towards allowing Alfred to replace TextExpander in the wake of the Smile pricing/sync kerfuffle -- ideas like allowing tabs/form filling, input within snippet expansion, snippets triggering workflows/scripts, case sensitivity in snippets, etc. Thinking about what it would take for me to be able to replace the 250+ snippets I have in TE with Alfred snippets, there are two killer features....1) is snippets to trigger scripts (mostly for date math)....I suspect this is in the works....2) is the ability to use my snippets on iOS. As far as I've seen, this hasn't come up, but it seems like an area where Alfred could really raise the bar. Smile has a pretty widely adopted API ( https://smilesoftware.com/textexpander-ios/apps) but the TE keyboard itself is pretty slow and generic. So I'd like to see an Alfred iOS keyboard, either as part of Alfred Remote or a separate app. It could just do snippet expansion on iOS using Alfred's synced snippets. If it could run scripts, this would be even better. And for the icing on the cake, maybe it could communicate with Alfred on OS X, run a query and return the results (the kind of two-way communication I think people were hoping to see emerge with Alfred Remote). OR....now that Smile has lowered their price on TE 6 to $20/year for existing users, and $40/year or so for new users, maybe it would make sense to not invest development resources into snippets. For me at least (as an existing user) the revised TE pricing makes switching a lot less urgent and compelling -- the main concern is the need to rely on Smile's sync service. Hence the subject line....if Alfred is going to go all in with snippets and replace TextExpander, it seems like an iOS keyboard is going to be necessary for many users....if that's not on the roadmap, it might not be worth prioritizing snippet features. Thoughts?
  17. You can create multiple keywords for workflows already. Just add an additional keyword object and link it to the same outputs as the existing keyword. Keywords in Alfred's window aren't case sensitive. But you're right, snippets only allow a single case-sensitive keyword as it stands now. Re: conflicts with existing words, I'd recommend pursuing an approach that uses punctuation or double letters to avoid that possibility. The approach I've been using for the last couple years is the dot notation described here: https://medium.com/@zholmquist/textexpander-abbreviations-b8e094526bfd#.ib6susgdv
  18. It would be great to be able to hold a modifier key when opening an app from Alfred, and have it open in the background without stealing focus. This can be done from the command line with open -g path/to/app and I could create workflows for each of my commonly used apps to allow this....but it would be great as a built-in feature.
  19. Yep, working now, thanks! Doing the Boolean searches from Caleb's original request is going to be more of a challenge....
  20. details and sample workflow that shows the problem here: http://www.alfredforum.com/topic/8868-alfred-v3-dynamic-filters/
  21. If I read your intention correctly, you can create a new workflow trigger that does nothing but post a notification, then call that via Applescript instead of using "display notification" It'll look something like tell application "Alfred 3" to run trigger "xxxxx" in workflow "xx.x.x.x.x" with argument xxxx ​but the workflow trigger object will give you the exact code
  22. What I did was to look for the block of html in the source that had the advanced search form, which was here: <!-- CONTENT ELEMENT, uid:61050/text [begin] --> <div id="c61050" class="csc-default"> <!-- Text: [begin] --> <p class="bodytext"><a href="https://search.ebscohost.com/login.aspx?direct=true&authtype=ip,guest&custid=s8336272&setup=1&groupid=main&profile=eds"title="Ouvre un lien externe dans une nouvelle fenêtre" target="_blank">Recherche avancée</a></p> <!-- Text: [end] --> </div> <!-- CONTENT ELEMENT, uid:61050/text [end] --> and then add the &bquery element that we saw in the earlier cryptic URL to the URL in that <a> tag above.
  23. After a bit of poking around in the source, I believe this should work: https://search.ebscohost.com/login.aspx?direct=true&authtype=ip,guest&custid=s8336272&setup=1&groupid=main&profile=eds&bquery={query} or for author https://search.ebscohost.com/login.aspx?direct=true&authtype=ip,guest&custid=s8336272&setup=1&groupid=main&profile=eds&bquery=AU+{query} or for title https://search.ebscohost.com/login.aspx?direct=true&authtype=ip,guest&custid=s8336272&setup=1&groupid=main&profile=eds&bquery=TI+{query} I've been assuming that's the search you wanted, not the search box for the library site or the hidden tab search for just the library catalog.
×
×
  • Create New...