Jump to content

nlippman

Member
  • Posts

    9
  • Joined

  • Last visited

nlippman's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Is it possible in a ScriptFilter to specify multiple modifier keys for a given item? For example, I know I can specify, for example: “mods”: { “alt”: { <stuff related to a selection with the alt key pressed }, “ctrl”: { <stuff related to a selection with the ctrl key pressed } } However, I haven’t been able to find an example of the syntax if I want to specify what happens to a selection made with both alt and ctrl pressed. Is that even possible in a script filter, and if so, what is the correct syntax? Thanks!
  2. I think others have also made similar suggestions, and this would be extremely helpful. It would be idea to be able to a) have multiple connections between a trigger and an action, so that you could connect the trigger and action with both a "regular" connection, as well as connections that are used when different modifiers (ctrl, cmd, opt, shift) are held down. This would primarily be of benefit when using a script action, in which case the script should have a mechanism for detecting whether a modifier was held down at the time of the selection or not. (It might even be useful to have multiple modifier keys allowed, so you could cmd-option a action, for example. It would also be useful to be able to change the arg value when a modifier is held down, just as subtext can be changed, using a script filter, e.g.: <?xml version="1.0" encoding="UTF-8" ?> <items> <item uid="UID" valid="yes"> <title>First item in script filter output</title> <subtitle>Unmodified subtitle</subtitle> <arg>Argument for unmodified selection</arg> <subtitle mod="cmd">Subtitle when cmd is held down</subtitle> <arg mod="cmd">Different arg can be used when cmd is held down</arg> </item> </items>
  3. OK, so that works in terms of being able to pop up the "menu" of available Taskpaper files, and I can then select one of them via keyboard, command-key combination, etc. I discovered that for the autocomplete, you need to put spaces around the text as whatever the autocomplete value is, it is added to the Alfred buffer, so if you want spaces before and after, you need to do them manually. Now, the problem is that once I have selected one of the items, OR if I type the filename by hand, I need a way of getting the menu of choices to be deactivated. Otherwise, you cannot send anything to Alfred. Each time I hit enter, it just adds the topmost item from the selection choices to the buffer. There must be some way of telling Alfred that after you have made one selection you then deactivate the selection menu, but I don't see how to do that. Any ideas?
  4. I'm not sure how to title my question, so hopefully you are reading this (!). I'll just describe what I am trying to accomplish and hopefully someone can help me out. I use Taskpaper for my todos, synced via Dropbox, so all of my Taskpaper files are stored in ~/Dropbox/Taskpaper. I want to create a workflow to rapidly add a task to the Inbox project of a selected file, so the syntax would be something like: tp <filename> <text of item to enter> [@tag @tag] Easy enough so far. However, what I was hoping to do is, when the "tp" command is first entered, present a listing of all of the taskpaper files in that folder so that I can see the list and decide which one to type for the task entry. Also easy enough. But (and here's my question, finally): what I would also like to be able to do is to select once of those files, either with the arrow keys and hitting enter, with a mouse click, or with a command-number keypress, and have the name of that file then entered in the Alfred command box, and then I can continue typing the rest of the entry. I don't see anyway to make that happen. I think I could do this by chaining workflows via osascript as has been detailed in one of the pinned postings, but that's not completely ideal, especially with the flashing of the Alfred dialog box, so it isn't elegant. Is there a way to accomplish this? Thanks!
  5. I am doing something much less complex. I just want to be able to mute or unmute the sound. I use a keyword, "mute". If I type "mute on" the sound is muted; "mute off" unmutes, and "mute" toggles the mute status. I don't set sound levels (although it would be pretty easy to modify my workflow so that if you type "mute ##" the sound is set to level "##". Anything argument but "on" or "off" causes the script to just do nothing. Very simple, but meets my needs. I just use a keyword trigger to fire a bash script, that reads as below. Note that I force the keyword to lowercase in the first line. You could obviously tie this to different triggers if you wanted to. Hope this is helpful. ----- # If no argument is given, toggle the muted setting. # If 'on' or 'off' is the argument, set muted setting accordingly. # If argument is anything else, do nothing. arg=`echo "{query}" | tr "[:upper:]" "[:lower:]"` muted=`osascript -e "output muted of (get volume settings)"` case "$arg" in on) setting="with" ;; off) setting="without" ;; "") if [ "$muted" == "false" ] then setting="with" else setting="without" fi ;; *) setting="" esac if [ "$setting" != "" ]; then `osascript -e "set volume $setting output muted"` ; fi
  6. Sorry if this has already been answered; I could not find an answer in the forum. I have a few workflows in which I have embedded scripts (usually python). In a few scripts that I have downloaded from others (mostly to help me learn the tricks of Alfred scripting), I frequently see that the workflow folder, once the workflow has been installed, has additional files in which the scripts are stored. For example, the workflow will use a script filter, but instead of the entire script being embedded in the script filter component itself, the script filter will just be: myscript {query} and the workflow folder, once installed, has a file named, of course, myscript.py (assuming a python script) which contains the program logic. Some of these workflows even have subfolders with utility scripts and the like. How do I create a script filter and add in external files? Thanks.
×
×
  • Create New...