Run a shortcut with folder as input

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Run a shortcut with folder as input Wed May 31, 2023 7:09 pm • by Glaubrecht
Hi, I want to run a shortcut that takes the folder as input, but I get the following error message from hazel:

Error executing Shortcut via commandline.


Here are Screenshots of the rule and the screenshot
https://imgur.com/a/DCBk3RA

Do you have any idea why this could be?
Glaubrecht
 
Posts: 3
Joined: Wed May 31, 2023 7:06 pm

Re: Run a shortcut with folder as input Thu Jun 01, 2023 8:35 am • by Mr_Noodle
Can you edit the "input from" field to be "nowhere"? Unfortunately, Shortcuts is a bit obtuse but I'm guessing it's not a good idea to be overly specific with it.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Run a shortcut with folder as input Fri Jun 02, 2023 8:27 am • by Glaubrecht
Mr_Noodle wrote:Can you edit the "input from" field to be "nowhere"? Unfortunately, Shortcuts is a bit obtuse but I'm guessing it's not a good idea to be overly specific with it.


I tested that but it still returns the error.

Does hazel run shortcuts via command line? Is it possible, that shortcuts run via command line don't take folders as input?

shortcuts run "Select and set git user" -i xyz

returns
Error: The file “xyz couldn’t be opened.


So maybe that's the problem here? Not sure..
Glaubrecht
 
Posts: 3
Joined: Wed May 31, 2023 7:06 pm

Re: Run a shortcut with folder as input Fri Jun 02, 2023 9:13 am • by Mr_Noodle
Hazel does use the commandline as, at least at one point, the "mandated" way to run Shortcuts was broken. I'll have to look at it again but it seems to be a more general problem than Hazel. Does it work if you send it a file?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Run a shortcut with folder as input Mon Jun 05, 2023 3:47 am • by Glaubrecht
Mr_Noodle wrote:Hazel does use the commandline as, at least at one point, the "mandated" way to run Shortcuts was broken. I'll have to look at it again but it seems to be a more general problem than Hazel. Does it work if you send it a file?


Yes, a file as input works fine.
Glaubrecht
 
Posts: 3
Joined: Wed May 31, 2023 7:06 pm

Re: Run a shortcut with folder as input Mon Jun 05, 2023 8:38 am • by Mr_Noodle
Maybe get rid of the "Folders" requirement on the input in the shortcut?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron