Jump to content

Search the Community

Showing results for tags 'argument'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL




Found 7 results

  1. Hello forum, What's the best practice for a workflow trigger (keyword or script filter) that uses an optional argument with a fallback value? Example 1 (I made this up): I want to more easily yell at people on the internet, so I have a workflow that turns text to caps. My clipboard is "foo". I call caps and expect my script to receive "foo". I call caps wasd and expect my script to receive "wasd". Example 2: Like example 1, but instead of the contents, I want to use hardcoded text. I call caps and expect my script to receive "your mother". ... What's the best practice to do that? This would be the in-script solution. Is there a built-in way to do this? import sys from AppKit import NSPasteboard, NSStringPboardType def getClipboard(): pb = NSPasteboard.generalPasteboard() pbstring = pb.stringForType_(NSStringPboardType) return u"Pastboard string: %s".encode("utf-8") % repr(pbstring) query = sys.argv[1] if len(sys.argv) >= 2 else getClipboard() # query = sys.argv[1] if len(sys.argv) >= 2 else "your mother" #example 2 sys.stdout.write(query.upper())
  2. Currently, if I output the following: {"items": [ { "title": "Foo", "arg": "unicorn" } ]} I have to handle the `unicorn` arg in a connected output action in the workflow. It would be useful to be able to dynamically handle it without needing to create an output action. This can be useful for very dynamic results and creating reusable modules that create output with different actions. I propose adding a `script` property to the JSON format that when specified makes it not pass the output to any connected output action (like `valid: false`) and instead executes the `script` and passes `arg` to it. {"items": [ { "title": "Foo", "arg": "unicorn", "script": "run-foo.sh" } ]} This would make script filters a lot more powerful.
  3. Hi, I hope I make sense here. What I'm trying to do: Workflow that... - uses a keyword + argument - opens a URL - has a delay - runs applescript to do "cmd + f" so I can search the page - (what I haven't figured out) add a step that types out the original query So if I type keyword then "elephant" I eventually want those last workflow steps to do a "cmd + f" on the page then type "elephant". Is this possible?
  4. When using Keywords and Arguments to open specific URL's, it would be great to be able to specify another URL to be used incase of no argument, instead of the same url with a part missing. for example; url with Argument; https://www.google.com.au/?q={query} URL without argument automatically goes to a different URL; https://news.google.com.au
  5. Hi guys, I'm trying to create a simple alfred workflow (Keyword -> Run Script -> Post Notification) using ruby. If I run this scripts in the terminal, it runs just fine, but when I try to run them on Alfred, I get some errors: ruby start.rb {query} [ERROR: alfred.workflow.action.script] Code 1: -e:1:in `<main>': undefined local variable or method `start' for main:Object (NameError) I assumed that ruby wasn't in Alfred path so I tried /usr/bin/ruby start.rb {query} and got this error: [ERROR: alfred.workflow.action.script] Code 1: -e:1: unknown regexp option - b -e:1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' /usr/bin/ruby start.rb asda If I use double quotes on the script name i get this errors: ruby "start.rb" {query} [ERROR: alfred.workflow.action.script] Code 1: -e:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input and /usr/bin/ruby "start.rb" {query} [ERROR: alfred.workflow.action.script] Code 1: -e:1: unknown regexp option - b -e:1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' /usr/bin/ruby "start.rb" asda ^ -e:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input Can someone enlighten me why this is happening? Thanks!
  6. I'd like to request the ability to have different types of arguments. you could have one type be 'iterator' which iterates through the argument data presented, processing each delimited entitiy as if the invoked action were called with just that string as the argument you could have another type be 'multi-var' which permits one to pass multiple independent strings to a workflow, which could be referenced as elements of an array, or enumerated strings, or whatever. this would be backwards compatible, since existing workflows would still be using the string typed handler, which wouldn't need to change, perse the goal is to allow one to provide structured data to a workflow, be it an array of strings, or a hash of kv pairs, or multiple variables to one script. I think the existing functionality is good, but with more flexibility, I think the community could do some really cool things that are currently pretty awkward to accomplish, and feel hacky.
  7. Now you can set a custom text as the Hotkey (trigger) argument. This is useful when the workflow needs a custom user information e.g. the Dropbox ID for public links (it is different for each user). Here is my Dropbox workflow: http://www.alfredforum.com/topic/460-workflow-move-selected-finder-file-to-dropbox-url-to-clipboard/?p=2090 In order to make things easier for the user it would be great to have the same Hotkey text argument for the Keyword: instead the Hotkey the user may bring Alfred and type only the keyword (no argument necessary to be typed) and the workflow would start ({query} would be the text argument, of course). I hope I was clear. In resume, maybe it would be interesting to have a better way to ask for user personal information such as the Dropbox ID. Maybe, a text box where the user could input his information that will be available as a constant (like {query}) to be used in the workflow.
  • Create New...