Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by dfay

  1. Thanks for following up. I checked the plist and it does have some devices without the Tabs key. I tried the new version and had the same result - Alfred reverts back to a regular search for "tabs". But if I run the new script from Terminal, it runs without an error & produces what looks to me like properly-formed XML output. And the output validates when pasted here: http://www.w3schools.com/xml/xml_validator.asp . I'm not sure what would cause Alfred to stop the script when it runs fine in Terminal. Any thoughts?
  2. This immediately reverts to a regular Alfred search for "tabs" for me. When I copied the script into a file and ran it in terminal it throws up the following error: Traceback (most recent call last): File "./tabs.py", line 44, in <module> devicetabs.append([x['value']['DeviceName'], x['value']['Tabs']]) KeyError: 'Tabs' I have three devices with iCloud tabs visible from Safari & can open them from Safari without problems.
  3. I think I have made some progress figuring out what is up. When I tried the search, that wasn't working in Alfred, in Terminal, I got the result Warning: SimpleXMLElement::addChild(): unterminated entity reference above the XML output. Other searches work. The problem search had "\&" in the Title field of one of the publications. When I replaced that with the word "and" , Alfred went back to finding the results successfully, and the search didn't give the warning when running search.php directly in Terminal.
  4. Hi This has stopped working for me for some reason. I type bib & get the Search in Bibdesk library... prompt in Alfred, select it and start typing, then Alfred immediately bumps me to the default Google search for "bib " & whatever I typed. If I manually run search.php in Terminal, it outputs the correct results, XML formatted. Any ideas? thanks Derick
  5. This is a great workflow. I'm wondering if it could be easily edited to show only reminders coming up in a given period. e.g. r month - reminders in the next month & overdue r week - reminders in the next week & overdue r soon - reminders in next __ user defined period I have a lot of reminders set up for recurring tasks that happen every 3-6 months, or once a year, and would like an easy way to suppress them.
  6. Cool. Unfortunately from del.icio.us days I have been in the habit of tagging stuff toread rather than using pinboard's built-in functionality. Would it be easy to have this also search for the tag toread? or do you have a script that could easily mark everything tagged toread as toread in Pinboard?
  7. I set this up with "Keyword to Script to Notification" and it runs perfectly fine as far as I can tell - echoed the output to the notification as expected. I edited the case statement to change elemC to a fixed string, as a way of testing that the for loop definitely ran, and it worked that way as well. What makes you think it isn't working?
  8. I've looked quickly at some options using Perl and Python (as well as bash tr , the existing approach) & none of them have worked for me....I'm not an expert in either though. http://ubuntuforums.org/showthread.php?t=1054470 http://bioinfo2.ugr.es/documentation/Perl_Cookbook/ch01_10.htm Both of these work for unaccented characters, but not for accented. If you can find a script that works, hooking it into the workflow should be trivial.
  9. This can all be done with workflows, like this one: http://www.alfredforum.com/topic/2180-case-converter-including-title-case/
  10. I just tried David's script. It doesn't work for me either, but I get the following message in system.log : Jun 26 10:52:05 mycomputernamehere.local osascript[7485]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/Satimage.osax" Then I updated satimage (here : http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html ) and now it still fails, but without any message in the log.
  11. Thanks. This is a great time-saver. I copied the icon from the actual Library folder and replaced the icons that come with the workflow - the workflow icons had a white background, whereas the actual Library folder icon has a transparent bkgd. & looks much nicer with colored backgrounds in Alfred.
  12. Found my answer.... http://arstechnica.com/civis/viewtopic.php?f=19&t=53074
  13. Title pretty much says it all. I have a workflow which is syncing via Dropbox, & which I use on three different machines, but which requires a hard-coded path that varies on each of the machines. Is there a quick and easy system variable or something I can use to identify which machine I'm running on? Applescript or bash-based preferably.... I realize this isn't really an Alfred Q. but hopefully someone can help. thanks Derick
  14. See the first pinned topic in this forum: http://www.alfredforum.com/topic/1283-how-to-script-filters-reusing-a-single-script-filter-or-chaining-multiple-together/
  15. I think you could add an if...then to only execute the click statement if the checkbox is checked. Some guidance on how to do so is here: http://stackoverflow.com/questions/9690129/tick-a-checkbox-only-if-its-not-selected & here: http://stackoverflow.com/questions/13021798/verify-a-checkbox-before-clicking-with-applescript Your code is the post above would need to begin tell application "Finder" (i.e. with the app name quoted).
  16. Create a workflow that calls this Applescript: http://lifehacker.com/5745770/toggle-sharing-preferences-in-os-x-with-a-one-click-applescript
  17. This is an extremely useful feature that I've somehow missed for months! Thanks.
  18. Should be easy to do since all the code for accessing last.fm API is already in this workflow: http://www.alfredforum.com/topic/2257-dj-pedro-itunes-playlist-based-on-lastfm-similar-artists/?hl=pedro
  19. Here's a revised version that works great for me. The only issue is that you need to hard-code a default directory for your TaskPaper files, which may not work with the way you work.... I keep all mine in a single directory in Dropbox so it works for me. Since Spotlight is now only searching a single directory, rather than the entire user home space, it's basically instantaneous. (BTW thanks to Gianni for writing nice self-documenting code that was v. easy to debug & modify ) -- Releas version: 1.1.1 -- Developed by Gianni Rondini -- more info at dropbyte.tumblr.com -- send bug and fix requests to -- giannivt [at] gmail [dot] com on alfred_script(evTest) set tpdir to "~/Dropbox/TaskPaper" set doc to "" set prj to "" set todo to "" set subSep to " sub " set inSep to " # " set noDoc to 0 set noPrj to 0 if evTest contains subSep then if evTest contains inSep then -- checking specific document set text item delimiters to inSep set prj_h to text item 1 of evTest set doc to text item 2 of evTest --saving document name set text item delimiters to subSep set prj to text item 2 of prj_h --saving project name set todo to text item 1 of prj_h --saving todo else set text item delimiters to subSep set prj to text item 2 of evTest --saving project name set todo to text item 1 of evTest --saving todo set doc to "toSave" --saving document name set noDoc to 1 end if else if evTest contains inSep then -- checking specific document set text item delimiters to inSep set todo to text item 1 of evTest --saving todo set doc to text item 2 of evTest --saving document name set prj to "Inbox" --saving project name set noPrj to 1 else set prj to "Inbox" set doc to "toSave" set todo to evTest set noDoc to 1 set noPrj to 1 end if end if if (doc as text) contains " " then set AppleScript's text item delimiters to " " set newText to text items of doc set AppleScript's text item delimiters to "\\ " set doc to newText as text end if tell application "TaskPaper" activate if noDoc is equal to 0 then set p to do shell script "mdfind -onlyin " & tpdir & " \"kMDItemFSName=='" & doc & ".taskpaper'\"" if (p as text) contains return then set Applescript's text item delimiters to return set lista to text items of p set p to {choose from list lista} end if if p is not equal to "" then open p else display dialog "Error: " & quote & doc & quote & " file does not exist!" with icon 1 buttons {"Cancel"} return end if else make new document with properties {name:doc} tell front document delete entries end tell end if tell front document if not (exists project named prj) then make new project with properties {name:prj} at front of projects end if tell project named prj make new entry with properties {text line:todo} end tell end tell end tell end alfred_script
  20. So I just tried both of the above commands in Applescript Editor. set p to do shell script "find ~ -iname work.taskpaper" returns an error in AppleScript Editor, presumably from the Permission denied messages from trying to find in savedState files in the Library. set p to do shell script "mdfind -onlyin ~ \"kMDItemFSName=='work.taskpaper'\"" returns the desired file, without any error messages. When I add the second line back to the original workflow as set p to do shell script "mdfind -onlyin ~ \"kMDItemFSName=='" & doc & ".taskpaper'\"" it still takes a long time (not quite as long as using find, but more than a minute) but does eventually add the item to the desired taskpaper file. So the question now is, is it really necessary to search ~ or can we restrict the search and get more speed?
  21. Ok....the multi-minute wait sees to be because of the line set p to do shell script "find ~ -iname " & doc & ".taskpaper" I just ran the shell script in terminal and it takes two minutes to run. And because it searches the entire home directory, it's trying to go into the Library folder and getting 15-20 lines ending in Permission denied tagged on the end. Is there a faster way of doing this search? Yes, with spotlight (mdfind) instead of find. >time find ~ -iname work.taskpaper ... real 2m16.608s user 0m0.465s sys 0m3.211s >time mdfind -onlyin ~ "kMDItemFSName=='work.taskpaper'" real 2m9.366s user 0m0.007s sys 0m0.006s user & sys time are way faster (which makes sense since Spotlight is caching all the info. that find is discovering afresh). Moreover using Spotlight only returns the desired file, rather than the desired file plus a whole bunch of Permission denied lines. I don't have time to work on this further right now but it seems pretty clear that the delay (at least - and possibly the error) is related to the do shell script... line in the code above. D
  • Create New...