c-c-c-c
-
Posts
13 -
Joined
-
Last visited
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by c-c-c-c
-
-
Checking in about this … can’t seem to to find any info in the documentation/help either.
-
-
Sorry to keep this going, one more thing –
It's not possible to split arguments in a query using the Args and Vars utility?
If so, what would that syntax be?
-
37 minutes ago, vitor said:
On the other objects you can only get one at a time through {query}.
Ah got it - this is what was tripping me up. Thanks for the explanation. I thought there might be a possibility of accessing the individual arguments within a workflow object (copy to clipboard, open url, et.)
It might be helpful if the example in the help be amended with that caveat (or an explanation of the difference between args and vars):
https://www.alfredapp.com/help/workflows/inputs/script-filter/json/
While optional, it's highly recommended that you populate
arg
as it's the string which is passed to your connected output actions. If excluded, you won't know which result item the user has selected.It is also possible to pass multiple arguments via an array of strings:
"arg": ["~/Desktop", "~/Pictures"]
-
Yes you're right, I'm conflating arguments/variables (I thought they were the same and couldn't find any documentation clarifying the difference).
Attaching a screenshot of the workflow.
Ultimately, what I'm curious about is how to use arguments downstream in my workflow:
Given I'm passing this (in a bash script filter):
"arg": ["Services", "4A7B6A86-460D-4C90-8E20-82DD061E0016"]
How do I access those arguments in a copy to clipboard or open url action:
to generate a markdown link in copy to clipboard:
[{Services <-- what is the syntax to echo the first argument }](x-devonthink-item://{4A7B6A86-460D-4C90-8E20-82DD061E001 <-- what is the syntax to echo the 2nd argument)
to generate a url in open url:
x-devonthink-item://{4A7B6A86-460D-4C90-8E20-82DD061E0016 <-- what is the syntax to echo the 2nd argument}?reveal=1
I've solved this by avoiding (multiple) arguments all together and using @deanishe's excellent guide Workflow/environment variables in Alfred — deanishe.net
and outputted a variable instead in my script filter:
(excerpt)
{ "title": "Design Services", "subtitle": "Business", "arg": ["Design Services"], "variables": {"uuid": "4A7B6A86-460D-4C90-8E20-82DD061E0016"}, "match": "Design Services " },
and accessing the variable (var:uuid) and first arg(query) downstream using:
[{query}](x-devonthink-item://{var:uuid})
but how would I do this using only arguments?
-
I am trying to get to this final output (in Copy to Clipboard)
[{var:var1}](x-devonthink-item://{var:var2})
-
Hi,
I've got the following (truncated here to show 2 results) json in a script filter. I'm passing out two args:
{ "items": [ { "title": "Business", "subtitle": "Practice", "arg": ["Business", "B5F64C25-6C8D-4771-A9D7-7A86F7D98B95"], "match": "Business " }, { "title": "Design Services", "subtitle": "Business", "arg": ["Services", "4A7B6A86-460D-4C90-8E20-82DD061E0016"], "match": "Design Services " } ] }
I'm outputted multiple arguments based on this:
QuoteWhile optional, it's highly recommended that you populate
arg
as it's the string which is passed to your connected output actions. If excluded, you won't know which result item the user has selected.It is also possible to pass multiple arguments via an array of strings:
"arg": ["~/Desktop", "~/Pictures"]
https://www.alfredapp.com/help/workflows/inputs/script-filter/json/
How do I parse the arg into two variables I can access later in my script? I've tried a split arg with newline as delimiter, which isn't working.
Can I access them directly (without split arg)? `{var:1}` or `{var:var2}` doesn't seem to work either.
-
-
no, the filename is a uuid, and didn’t see an automation task that returns a metadata field
-
Hi There,
Is there a way to get expose the value of `kMDItemDisplayName` in a workflow?
I have a file filter from which I'm trying to extract the value of `kMDItemDisplayName` so I can output a markdown link on the pasteboard.
It's exposed in the title field of the results, but there doesn't seem to be a programmatic way to access it? I looked through the Automation Tasks and couldn't find anything. Also looked through the documentation under dynamic placeholders (would be great if file metadata could be exposed this way). I can't use `{query} ` as it returns a path and the filename is a uuid.
Thanks
File Filter: is it possible to limit by multiple tags?
in Workflow Help & Questions
Posted
@sepulchra I don’t really use alfred’s defualt tag search feature (maybe I should).
This is part of a custom workflow that searches within a Devonthink database for markdown files tagged cheatsheet. I have a separate workflow for files tagged with note.
I want to combine the two (notes or cheatsheet), but all methods i’ve tries seem to result in notes and cheatsheet