Jump to content

effe

Member
  • Content Count

    18
  • Joined

  • Last visited

  1. Thank you. Apologies for not following up. I did end up just making a simple script that I run periodically to clear out short history items: #!/usr/bin/env bash threshold=3; sqlite3 "${HOME}/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" <<STATEMENT DELETE FROM clipboard WHERE datatype = 0 AND LENGTH(TRIM(item)) <= $threshold; STATEMENT echo "text clipboard items with length <= $threshold removed from Alfred history"
  2. Is it possible to remove several clipboard history items at once? I would for example like to be able to occasionally, on demand, be able to remove all clipboard history text items < 3 characters long. I know I can fn-delete individual items in the list, but I'd like to be able to perhaps activate a workflow to prune the clipboard history list en masse. Any ideas? Possible?
  3. Who capitalizes directory names? Updated the workflow. Fingers crossed. For anyone following along: you need to open the workflow and update the baseDir in the script filter to point to your desired directory. Same link as previous post: https://www.dropbox.com/s/33szngyros5nvhp/open%20%20localhost%20sites.alfredworkflow?dl=0 @deanishe, thank you for the pointers.
  4. Sorry for the necro-post, but I was just wondering the same thing. Any way we can have multiple argument fields to pass around? currently it's <arg>...</arg> but it'd be so great to have: <args> <arg></arg> <arg></arg> <arg></arg> <arg></arg> </args> or even better maybe just an attribute and still allow multiple arg tags as long as they're distinct <arg modifier="none">foo</arg> <arg modifier="cmd">bar</arg> <arg modifier="ctl">baz</arg> <arg modifier="shift">foo bar baz</arg> and to be backward compatible, <arg>foo</arg> == <arg modifier="none">foo</arg> Yes!?
  5. Here's another way to do it: ** edit ** I've uploaded a link to the workflow https://www.dropbox.com/s/33szngyros5nvhp/open%20%20localhost%20sites.alfredworkflow?dl=0 by default, it opens the folder, and cmd opens the url - Create a new workflow - Add a script filter - add your keyword, with space, argument optional - make sure language is /bin/bash - de-select all of the escaping options in the script window, add baseDir="/absolute/path/to/folder/" ./shallowDirectorySearch.sh "$baseDir" "{query}" - open the workflow folder and create shallowDirectorySearch.sh - make it executable ( chmod +x shallowDirectorySearch.sh ) - type or copy pasta the following into the file: shallowDirectorySearch.sh #!/bin/bash baseDir="$1" query="$2" out="$(ls -d "${baseDir}"*${query}*/)" echo '<?xml version="1.0" encoding="utf-8"?>' echo "<items>" echo "$out" | while IFS= read -r line do escapedline="$(echo $line | sed 's/ /\\\ /g' )" base="$(basename "$escapedline" )" echo '<item valid="yes">' echo '<title>'$base'</title>' echo '<subtitle>'$line'</subtitle>' echo '<arg>'$line'</arg>' echo '</item>' done echo "</items>" exit - add a run script output and connect the events query="{query}" escapedline="$(echo $query | sed 's/ /\\\ /g' )" base="$(basename "$escapedline" )" open "http://localhost/$base" have fun!
  6. [ solved! See edit ] I took inspiration(and, temporarily: the data file, and the icon) from the recently updated workflow for unicode search ( http://www.alfredforum.com/topic/1404-find-and-paste-unicode-symbols-arrow-triangles-greek-and-more/ ), and wrote a parser in a little bash script for practice. It seems to work fine, it's just that in the debugger, it shows an error. Any ideas to fix this would be welcome! Thanks No file upload here ? https://www.dropbox.com/s/muv4cjmwbva40zk/Unicode_search.alfredworkflow?dl=0 Sample error output: (there are characters in the arg and text copy fields,.. this forum seems to be stripping out unicode. [ERROR: alfred.workflow.input.scriptfilter] Code 1: <?xml version="1.0" encoding="utf-8"?> <items> <item valid="yes"> <title> - mathematical sans-serif bold italic small tau</title> <subtitle>unicode: 1d7bd</subtitle> <arg></arg> <icon>noicon.png</icon> <text type="copy"></text> </item> </items> edit: haha, *doh* , I had an invalid exit code at the end of my script.. exit 1 .. haha, I originally had a fail condition there, and forgot to remove the bad exit status when I removed the condition. yikes, that's like an hour I'm not getting back. Thanks. It works pretty well I think.
  7. Hi, I'm working through my first script workflow and it works as I expect, but when I look at the debug in alfred, it outputs [ERROR: alfred.workflow.input.scriptfilter] Code 1 just before the output of the xml. I'm having a hard time finding any information regarding this. Maybe I'm just not looking in the right spot? Thanks for any advice.
  8. Hi, Looks like an interesting workflow. I noticed in your recent commits that it looks like you hard-coded a file from your environment as the symbols file.. https://github.com/bevesce/unicode-symbols-search/blob/master/symbolssearch.py#L45 so I tried changing that to the symbols.txt file , but the parser barfs on the file: [ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 38.)'. Row (null), Col (null): 'Unescaped '<' not allowed in attributes values' in XML: [...] I'll try to take a look at the file to see if I can figure out what's wrong, but maybe you are faster? Thanks edit: so now I see that that is supposed to be a temporary file. for those interested, just take out the absolute path and everything will work just fine. i.e. just leave 'a.txt' as the argument in the above referenced line.
  9. Hi, I'm already using your menu bar search workflow. It's nice. Thank you. Sorry I wasn't more clear, I was actually wondering if Alfred could make it's keywords available to be read by an app like KeyCue, which displays available hotkeys and menu items in a pop up. No matter though, I'm learning the keywords and hotkeys steadily enough. It would be nice to see them laid out in one place though.
  10. Put this thing on Github! I added a simple sort to the time zone list based on the UTC. within the same UTC it sorts alphabetically. just added a call to a short one liner script I made ( sortCities.sh below ) in add_city.sh right before the last echo . ./sortCities.sh "$timezone_file" sortCities.sh #!/bin/bash sed 's/UTC//g' "$1" | sed 's/+//g' | sort -t '|' -ngk 9,9 | sed 's/|/|UTC+/8' | sed 's/+-/-/1' > "$1" 2>&1 edit: Monkeyed around with it a bit more, and implemented a simple hour offset addition from your current timezone. added: calc.sh # from ( http://www.novell.com/coolsolutions/tools/17043.html ) #!/bin/bash echo "scale=1; $1" | bc;exit; getOffsetFromCurrentTimeZone.sh # from me #!/bin/bash timeZoneIn=$(echo "$1" | bc) utcData="$(date +%z | sed 's/+//g' | bc)" diff=$( . ./calc.sh "$timeZoneIn - $utcData" ) echo "$diff" and then in timezone_list.sh modified near the echo items statements: [...] utcOffset=$(echo "$display_offset" | sed 's/UTC//g' | sed 's/+//g') utcOffset=$( . ./calc.sh "$utcOffset * 100" ) utcVal=$( . ./getOffsetFromCurrentTimeZone.sh $utcOffset ) utcVal=$( . ./calc.sh "$utcVal / 100" ) utcVal=" $utcVal hours away " echo '<item arg="'$city_returned'|'$city_time'|'$city_date'|'$country'|'$tz_name'|'$display_offset'" valid="yes"> <title>'$city_returned: $city_time'</title> <subtitle>on '$city_date' • '$country' • '$tz_name' ('$display_offset') • ('$utcVal')</subtitle> <icon>./flags/'$flag_icon'</icon> </item>' [...] utcOffset=$(echo "$display_offset" | sed 's/UTC//g' | sed 's/+//g') utcOffset=$( . ./calc.sh "$utcOffset * 100" ) utcVal=$( . ./getOffsetFromCurrentTimeZone.sh $utcOffset ) utcVal=$( . ./calc.sh "$utcVal / 100" ) utcVal=" $utcVal hours away " echo '<item uid="custom" arg="'$city_returned'|'$city_time'|'$city_date'|'$country'|'$tz_name'|'$display_offset'" valid="yes"> <title>'$city_returned: $city_time'</title> <subtitle>on '$city_date' • '$country' • '$tz_name' ('$display_offset') • ('$utcVal')</subtitle> <icon>./flags/'$flag_icon'</icon> </item>' [...] also, I had to modify one of the if statements in timezone_list.sh because the comparison didn't like decimal numbers( some timezones with .5 hour offsets ): .. instead of comparing, just replace double sign if it's there. display_offset="UTC+$UTC_offset" display_offset=$( echo "$display_offset" | sed 's/+-/-/g')
  11. Any chance there could be integration in Alfred to work with a cheat sheet app like KeyCue?
  12. Thanks, I guess I'm misunderstanding at a basic level. For example: I invoke Alfred, and type 'find foo' At this point is where I'm confused. It seems like I can do two things to get to the actions panel.. either, press the tab key, or press opt-cmd-\ . Both take me to the action panel for the file I had selected in Alfred. Only the tab key action allows me back to Alfred with 'find foo' there when I press 'esc'.. the opt-cmd-\ hotkey path kicks me out of Alfred if I try to go back doing the same key press (esc). I started from the same location, and the only thing different is the key combination to get to the action panel, so it seems like it should do the same thing in both cases to get back? edit: Aaand yes, I think I understand now.. I'm not supposed to be using the opt-cmd-\ in the Alfred list. That was my confusion.. I just now realized that I can use that key combination in the Finder. Ha ha, can you tell I'm new to the way of the Alfred? Thanks. I get it. But it is( ~was) confusing that the 'external' key combo works in Alfred's list.
  13. When I use the appropriate 'Show Actions' button on a file/folder name, Alfred pulls up the action panel for the item.. and if I want to go back to the original Alfred panel, I can hit escape, and it puts me back where I was in Alfred. If I instead use the 'File Selection' hotkey to do the same, when I hit escape, it just kicks me out of Alfred. Is this by design? I think the hotkey invocation should act the same, but it doesn't appear to. Thoughts? Thanks
  14. Hi, Just trying out 'spell', and was thinking it'd be convenient to allow the word be opened in the dictionary like define too.. I mean, I didn't know how to spell 'onomatopoeia', and I wanted to know more, so yeah, not terrible >> enter, invoke Alfred, 'define cmd-v', enter..., but it's right there.. could we get a modifier, like maybe cmd-select to open in Dictionary.app?
  15. Thanks for that. Nice. Is there a location to find the enabled 'built-in' keywords too?
×
×
  • Create New...