Jump to content

Search the Community

Showing results for tags 'arg'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Twitter


Website URL


Jabber


Location


Interests

Found 2 results

  1. Hey guys, Say I make a Script Filter and link it to 4 script actions that each perform a different function, but each action needs a different input from the Script Filter, and this is where the problem begins, because the "arg" attribute can hold only one value which will work with just 1 of the 4 actions Right now the only workaround to this problem is to give the "arg" attribute a separated list of multiple values, and then each action would need to parse the input and search for its piece of data, but it's too much parsing and splitting involved.. My opinion is that we should have some freedom in the XML attributes of the feedback results by letting us define our own attributes in a result and Alfred would automatically send those attributes as individual parameters to the "alfred_script" function, as well as individual {attribute_name} to other predefined actions. For example, script filter would generate this xml result: ... <item uid="rdioartist" arg="r96664" valid="yes" autocomplete="Incubus" artistiname="Bjork" track="All is full of love"> ... And we, the programmers, would then use the following in script action: on alfred_script(arg, artistname, track) -- we use the parameter that is needed for a specific action end alfred_script [later edit]: a big problem with the current design is when you link a script filter to multiple actions AND a Notification action, because inside the Notification action we can't split the separated list of values of the "arg" attribute, and setting the arg attribute to a single value would make the other actions useless So with my suggestion above we would type something like {aristname} or {track} inside the Notification action
  2. The `arg` part of a script filter's result (the bit passed on as {query}) is oddly an XML attribute instead of an element. This makes it harder to pass on newlines in results--they just turn into spaces. The trick is to escape the newlines as an entity reference like: Most XML escape functions won't do that automatically, so you probably need to it yourself. Possibly double-quotes too. The best thing I came up with in Python is: from xml.sax.saxutils import escape safe_arg = escape(any_crazy_text, {'"': '"', '\n': ' '} ) I'd be happy to hear that there's a simpler way. Just passing this on since it stumped me at first.
×
×
  • Create New...