Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    62

Everything posted by dfay

  1. The easiest way to figure out a search URL is to do a search, then dissect the URL that displays the search result. So if I search for Bourdieu , that library produces a URL with a lot of cruft: https://eds.a.ebscohost.com/eds/results?sid=a907e052-7b42-4396-af76-278c2c68a208%40sessionmgr4001&vid=0&hid=4203&bquery=Bourdieu&bdata=JmNsaTA9RlQxJmNsdjA9WSZsYW5nPWZyJnR5cGU9MCZzaXRlPWVkcy1saXZl So the next step is to try stripping out everything but the query. unfortunately the simplest form https://eds.a.ebscohost.com/eds/results?bquery=Bourdieu results in an Internal Server Error and the other catalog link under the Catalogue Crésus produces URLs that don't have the query encoded. ... I thought this was going to be an easy question, since I've done this with a dozen or so university libraries before....but the catalog servers you are dealing with here are not so amenable to the usual approach. The next step is to start looking at the <form> tag within the underlying html and trying to reconstruct the URL that the page submits to the server to generate the search results.
  2. I put my workflows in Categories and filter the view as needed. https://www.alfredapp.com/help/workflows/organising-workflows/ An advantage here is that the category is stored with the workflow metadata, so it can be read without needing to find a way to query Alfred's UI to get the enclosing folder, and/or automatically change a folder field when the user drags stuff around in the UI.
  3. Just updated this with a new version for Alfred 3.
  4. grep -rl "tell application \"Alfred 2\"" * | uniq will give a list of files with the hardcoded tells. I have 22. user.workflow.1358A7BF-26C3-4312-BA23-D4E87BA625B6/info.plist user.workflow.1E4D4384-542C-406A-B5B2-35E4B7AB3C35/info.plist user.workflow.23A2D552-B4DB-4773-A336-ED82109C352D/info.plist user.workflow.2DED841C-F5F8-48A7-A695-383B1FCD3BE5/bundle/ruby/1.8/gems/alfred-workflow-1.8.0/lib/alfred.rb user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/info.plist user.workflow.38BEA6E3-5C51-490A-86AF-48D9C0A181C5/fav_recent.scpt user.workflow.5194A7D5-853C-43D5-8184-0D211A70DBA6/info.plist user.workflow.5FE95E1D-6088-4196-8EF0-2836A6D587DC/info.plist user.workflow.6546A6BB-6CB5-43A2-9F92-5C64C0AF61B8/info.plist user.workflow.6A3B9081-0EE4-4D19-8262-DEF0F76F4008/info.plist user.workflow.6D64B730-4FDA-49B6-8873-73D68B1A1BB1/info.plist user.workflow.783FD75D-DFEC-430B-8F1B-50548E7BC2F9/info.plist user.workflow.92CCE110-F193-44F2-8B89-D7BD4A606B02/scripts/process_list.sh user.workflow.B7F7ABD3-088C-4C3B-B040-CDF4665FB353/info.plist user.workflow.C0880408-EAC1-409E-A781-728C73FCA3A1/info.plist user.workflow.D8FFA36D-F645-4B24-817F-0BFD3182CBFD/info.plist user.workflow.F38F65DC-9AB3-464B-A68A-53BAA56C7EED/info.plist user.workflow.F38F65DC-9AB3-464B-A68A-53BAA56C7EED/zotquery.py user.workflow.FE4F8F24-B4C6-4AA1-89EE-330C97B76A43/info.plist user.workflow.FF564346-F29D-4386-BCE5-4A04E1A02B12/common.py user.workflow.FF564346-F29D-4386-BCE5-4A04E1A02B12/common.pyc user.workflow.FFB01EFB-9B79-47B3-9347-BABAF289E892/info.plist It's times like this that human-readable directory names would be a big help. Updated - here's the list above (minus a few of my own that aren't public) with the workflow names added in. A lot of these seem to work fine, but they do have code in them that is potentially broken: Updated again -- I've posted a new version of the Workflow Picker workflow for Alfred 3 (in its own thread). It took some poking around as preference file names had changed, but it wasn't too hard to update. user.workflow.1358A7BF-26C3-4312-BA23-D4E87BA625B6/info.plist - Date Calculator user.workflow.1E4D4384-542C-406A-B5B2-35E4B7AB3C35/info.plist - Citation Search user.workflow.23A2D552-B4DB-4773-A336-ED82109C352D/info.plist - Python Documentation user.workflow.2DED841C-F5F8-48A7-A695-383B1FCD3BE5/bundle/ruby/1.8/gems/alfred-workflow-1.8.0/lib/alfred.rb - Up Next (and maybe anything else built with this library) user.workflow.34B64201-8299-4E7C-85A1-F7736E15E97E/info.plist - BibQuery (smargh) user.workflow.38BEA6E3-5C51-490A-86AF-48D9C0A181C5/fav_recent.scpt - Recent Items (sztoltz) user.workflow.5194A7D5-853C-43D5-8184-0D211A70DBA6/info.plist - Yosemite GUI Mode user.workflow.5FE95E1D-6088-4196-8EF0-2836A6D587DC/info.plist - Workflow Picker (yes, I know that's one I wrote....) user.workflow.6A3B9081-0EE4-4D19-8262-DEF0F76F4008/info.plist - Rome2Rio (also mine...) user.workflow.6D64B730-4FDA-49B6-8873-73D68B1A1BB1/info.plist - Resolve URL user.workflow.783FD75D-DFEC-430B-8F1B-50548E7BC2F9/info.plist - Using Script Filters user.workflow.92CCE110-F193-44F2-8B89-D7BD4A606B02/scripts/process_list.sh - Egg Timer 2 (carlosnz) user.workflow.B7F7ABD3-088C-4C3B-B040-CDF4665FB353/info.plist - Subscribe to Feed URLs user.workflow.D8FFA36D-F645-4B24-817F-0BFD3182CBFD/info.plist - Pinboard (sztoltz) user.workflow.F38F65DC-9AB3-464B-A68A-53BAA56C7EED/info.plist - ZotQuery user.workflow.F38F65DC-9AB3-464B-A68A-53BAA56C7EED/zotquery.py - ZotQuery user.workflow.FE4F8F24-B4C6-4AA1-89EE-330C97B76A43/info.plist - Alfred Browser Toolbox user.workflow.FF564346-F29D-4386-BCE5-4A04E1A02B12/common.py - Reference Importer user.workflow.FF564346-F29D-4386-BCE5-4A04E1A02B12/common.pyc - Reference Importer user.workflow.FFB01EFB-9B79-47B3-9347-BABAF289E892/info.plist - Rename File
  5. To see which workflows might break, you can run the following bash command in your workflows directory: grep -r "tell application \"Alfred 2\"" * It produced 161 matches when I ran it in my workflows directory (with 151 workflows in the directory). So potentially there's a lot that can break. I deleted the DJPedro workflow which I never use, and that got it down to 64 matches right away, but it still looks like there are 20+ individual workflows that may break.
  6. I'm thinking still about using Alfred to replace TextExpander. TE allows snippets to run scripts. Alfred has snippets....and Alfred workflows can run scripts. So how about allowing Alfred snippets to be workflow triggers? And to go with this -- add a "Type Text" workflow output (with the option of replacing the incoming snippet). It seems like these would open up a whole lot of automation options, by linking up two existing features, and sticking with the paradigm that folks are used to in building Alfred workflows. D
  7. If I call up Alfred's input panel, then type a snippet, it doesn't auto-expand. The same snippet works fine in other text fields. And my TextExpander snippets work fine within Alfred's input panel. But I'd like to ditch TextExpander in the long run.
  8. Hi Caleb you can search a specific type of file with a File Filter by setting its file types then under the Advanced tab adding a metadata field for kMDItemTextContent -- this is the Spotlight metadata key for file contents (the default on a File Filter is to search filenames and Finder comments -- you may also want to delete these). In theory (moving on to the dream workflow...) you should be able save file type and tags to a variables, then use a JSON Config to pre-populate the File Filter's type and the search terms for kMDItemUserTags but in practice this doesn't seem to work. Here's the JSON I'm using: { "alfredworkflow" : { "config" : { "types" : [ "{var:fileType}" ], "fields" : [ { "words" : true, "value" : "{var:theTags}", "split" : true, "not" : false, "field" : "kMDItemUserTags" }, { "words" : true, "value" : "(query)", "split" : true, "not" : false, "field" : "kMDItemTextContent" } ] }, "variables" : { } } } I've set up a notification to confirm that the variables (fileType and theTags) are set correctly heading into the File Filter, but the File Filter never produces results. The JSON Config window says it should convert "(query)" to {query} in the File Filter, but maybe this doesn't happen. Vero, any suggestions? Here's the workflow-in-progress. https://dl.dropboxusercontent.com/u/6601556/Alfred/filtered%20search.alfredworkflow
  9. Hi Carlos I was just looking at the source of this to try something but I don't have Script Debugger so I can't actually make any changes. I am wondering if it would be possible to save a current list of recents (in my case to Dropbox) and then re-open it, reading from the list, rather running mdfind locally. Basically what I want is a way to save all my recents on computer A then go to computer B and view computer A's recents. Also it looks like the favorites.txt file is being stored locally in ~/Library/Application Support/Alfred 2/Workflow Data/com.sztoltz.recentitems/favorites.txt It seems to me it would be preferable to have this stored with the workflow so that if one is syncing workflows, the favorites would also sync. D
  10. @deanishe That command ins't exactly the same as what was in the recentitems plist ....it returns recently modified as opposed to recently opened files. but mdfind -onlyin $HOME '((kMDItemLastUsedDate > $time.now(-360m)) && (kMDItemLastUsedDate < $time.now()))' | grep -v /Library/ does the trick (I changed the time from 60 min to 360 min).
  11. Hey Wolph glad to hear you're willing to push forward. I realized that the problem I'm facing is not with the workflow but with the serial port Applescript library breaking on El Cap....so a python version may not help me unless the problem with pyserial has also been fixed....let me check that out.
  12. No it's working fine for me....I recently did a clean reinstall of El Cap on my laptop and just tried using Alfred Remote to start Dictation for the first time & it worked immediately.
  13. Wow...missed that completely. I'll look into pyserial and see how it fares on El Cap.
  14. @wolph if you're still around....El Capitan killed the Applescript library I was working with (SerialPort X) and there seems to be no update. How's that python version coming?
  15. Nice Dean....I have been using Alfred for nearly five years and never knew about the up arrow trick.
  16. Hmmm....I haven't ventured down the KM rabbit-hole before....I think I'll stick with TE 5 while it's working & see what Alfred 3 has to offer.
  17. I realize there isn't an Alfred 3 forum yet, but in the light of the TextExpander pricing debacle I'd be very curious to hear if Andrew and Vero could share more on the new snippet features coming in Alfred 3....
  18. Most of mine date back to my custom sidebar in Opera for Windows, adapted first for OnMyCommand and then to Alfred and OS X services. The general focus is on searching for academic literature, though more often than not I'll use Andrew Ning's outstanding Reference Importer which lets me import refs. directly to BibDesk. Google Scholar: alfred://customsearch/Search%20google%20scholar/gs/ascii/plus/http%3A%2F%2Fscholar.google.com%2Fscholar%3Fq%3D%7Bquery%7D JSTOR author search: alfred://customsearch/jstor%20author/jsta/utf8/noplus/http%3A%2F%2Fwww.jstor.org%2Faction%2FdoAdvancedSearch%3Fq0%3D%7Bquery%7D%26f0%3Dau%26c1%3DAND%26q1%3D%26f1%3Dall%26c2%3DAND%26q2%3D%26f2%3Dall%26c3%3DAND%26q3%3D%26f3%3Dall%26wc%3Don%26Search%3DSearch%26sd%3D%26ed%3D%26la%3D%26jo%3D JSTOR title search: alfred://customsearch/jstor%20title/jstt/utf8/noplus/http%3A%2F%2Fwww.jstor.org%2Faction%2FdoBasicSearch%3Facc%3Doff%26Query%3Dti%3A%7Bquery%7D%26gw%3Djtx%26prq%3Dau%253A%2528query%2529%26Search%3DSearch%26hp%3D25%26wc%3Don%26acc%3Doff Search UCR library (with a little modification this will work for many university libraries): alfred://customsearch/Search%20UCR%20libary/lib/ascii/noplus/http%3A%2F%2Fscotty.ucr.edu%2Fsearch~S5%2F%3Fsearchtype%3DX%26searcharg%3D%7Bquery%7D Search Melvyl (combined libraries of the U of California system): alfred://customsearch/Search%20Melvyl/mel/utf8/noplus/http%3A%2F%2Fmelvyl.worldcat.org%2Fsearch%3Fqt%3Dwc_org_melvyl%26q%3D%7Bquery%7D Search wunderground.com (weather): alfred://customsearch/Search%20weather%20underground/wu/ascii/noplus/http%3A%2F%2Fwww.wunderground.com%2Fcgi-bin%2Ffindweather%2FgetForecast%3Fquery%3D%7Bquery%7D Search WordWizard (Scrabble dictionaries): alfred://customsearch/wordwizard/ww/ascii/noplus/http%3A%2F%2Fthepixiepit.co.uk%2Fcgi-bin%2Fscrab%2FWordWizard.pl%3Fsearch%3D%7Bquery%7D
  19. You can also do this with Moom which lets you save named snapshots. You'd then run an Applescript at the end of the workflow which would look like this: tell application "Moom" arrange windows according to snapshot named "yournamehere" end tell IMHO Moom is the best OS X window manager out there. One further trick you can do is if you're using a laptop and a desktop, you can set up snapshots on each, customized per machine. Alfred will just run the script, and Moom will use the local version of the snapshot so your windows will be optimized for whichever machine you're working on at the time.
  20. Yes -- see https://www.alfredapp.com/help/workflows/inputs/file-filter/-- you can set up a file filter to limit the search scope to a particular folder.
  21. It's not so easy b/c the commands to open iTunes with a specific library or to choose a library aren't exposed to Applescript. Which means you'd need to write the iTunes preference file directly from the command line -- see http://stackoverflow.com/questions/1693780/applescript-to-launch-itunes-with-a-specific-library. Or script keystrokes in the Finder. Doug Adams, who probably knows more about iTunes automation than anyone around, seems to have given up on scripting multiple libraries: http://dougscripts.com/itunes/category/itunes-library-manager/
  22. Here's a version in Applescript which you can run in Script Editor to get you started. This assumes that there are four-digit codes as the last four characters of the file prior to the extension, and that the filenames are identical other than the codes. tell application "Finder" set theFiles to items of window 1 set theList to {} set missingFiles to {} sort theFiles by name -- build a list of the digits in the filenames repeat with f in theFiles set theName to name of f as string set strLength to (get count of characters in theName) -- get the four characters prior to file extensions set theNo to ((get characters (strLength - 7) thru (strLength - 4) of theName) as string) as integer set theList to theList & theNo end repeat -- check for missing numbers in the list of digits set lastItem to 0 repeat with n in theList if (n as integer) is not equal to (lastItem + 1) then set missingFiles to missingFiles & ("File " & lastItem + 1 & " is missing") end if set lastItem to n end repeat end tell return missingFiles
  23. Are the file names consistent? Will the serial # always be the last four characters of the filename?
×
×
  • Create New...