Shortcuts not running in Rules

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

Moderator: Mr_Noodle

Shortcuts not running in Rules Mon Feb 06, 2023 6:25 pm • by Zac
Hi all

I have a Shortcut that I am running to rename a file based on a Regex when I move it. Basically to remove a bunch of nomenclature from the end of the file name.

It works in Shortcuts and it works in the Finder but when I assign to to a rule nothing happens. It isn't appearing in the logs and no matter if I trigger it before or after the file moving it still isn't being launched.

Anyone have an idea why this would be the case?

TIA
Zac
 
Posts: 8
Joined: Mon Feb 06, 2023 5:49 pm

Re: Shortcuts not running in Rules Tue Feb 07, 2023 10:29 am • by Mr_Noodle
Can you post/send the shortcut?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Shortcuts not running in Rules Tue Feb 07, 2023 10:57 am • by Zac
Screenshot of it is here

https://imgur.com/a/sxNimKL
Zac
 
Posts: 8
Joined: Mon Feb 06, 2023 5:49 pm

Re: Shortcuts not running in Rules Wed Feb 08, 2023 10:39 am • by Mr_Noodle
I just entered in the shortcut (at least the first few actions. I don't think I have the "trim" action). I even added a notification at the end to print out the shortcut input.

Only other thing different was that I did not set the "input from <<>>" part. See if you can clear it out and see if it works after that.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Shortcuts not running in Rules Sun Feb 12, 2023 10:55 am • by Zac
What are you using to get the file reference?
Zac
 
Posts: 8
Joined: Mon Feb 06, 2023 5:49 pm

Re: Shortcuts not running in Rules Tue Feb 14, 2023 10:17 am • by Mr_Noodle
Not sure what you are asking. The file is sent in as input.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Shortcuts not running in Rules Tue Feb 14, 2023 10:20 am • by Zac
Could you post a screenshot of the Shortcut?
Zac
 
Posts: 8
Joined: Mon Feb 06, 2023 5:49 pm

Re: Shortcuts not running in Rules Wed Feb 15, 2023 10:43 am • by Mr_Noodle
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Shortcuts not running in Rules Sun Feb 19, 2023 9:58 am • by Zac
So the issue is, as many of you already know, that Shortcuts works on a copy of the file you send it. So in my case Hazel was sending the file to the Shortcut and then the Shortcut was working on a copy. Hazel then moved the file it had and then Shortcuts left its copy in a temp directory.

I rewrote the Shortcut so that it renamed the file and then moved it to the correct directory and then Hazel deleted the original.

Any chance that there can be a regex option added to the rename action?
Zac
 
Posts: 8
Joined: Mon Feb 06, 2023 5:49 pm

Re: Shortcuts not running in Rules Tue Feb 21, 2023 10:51 am • by Mr_Noodle
Not directly. Check out "match patterns" in the help for similar functionality.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron