jordikt Posted April 23, 2023 Share Posted April 23, 2023 Hi I bought Alfred 5 yesterday and I am doing a new workflow. The workflow has one "JSON Config" block that receives a query from a "List Filter" block. I want to set the variable "foldername" to the basename of the path that is in the query. How should I do it?? This is the content of the JSON block: { "alfredworkflow" : { "config" : { "scopes" : [ "{query}" ] }, "variables" : { "folder" : "{query}", "foldername" : "the name of the folder/file of the path of the query" } } } Link to comment
Stephen_C Posted April 23, 2023 Share Posted April 23, 2023 Isn't it easier (says the man who never understands JSON 😀) simply to use the Automation Task Get Path Dirname? Stephen jordikt 1 Link to comment
jordikt Posted April 23, 2023 Author Share Posted April 23, 2023 Thx @Stephen_C I have tried with the Automation "Get path basename without extension". It works fine. 😀 Link to comment
Stephen_C Posted April 23, 2023 Share Posted April 23, 2023 I'm glad that worked. Sorry for misleading a little with the Get Path Dirname: I always forget which is which! Stephen jordikt 1 Link to comment
vitor Posted April 26, 2023 Share Posted April 26, 2023 On 4/23/2023 at 5:38 PM, jordikt said: I have tried with the Automation "Get path basename without extension". It works fine. Alternatively, use Get Path Basename and tick the box to remove the extension. On 4/23/2023 at 6:18 PM, Stephen_C said: Sorry for misleading a little with the Get Path Dirname: I always forget which is which! Check the tasks’ description, which may make it clear. Their names are like that because that’s the typical nomenclature. If it helps, a folder is a directory, which explains the dir. jordikt 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now