Page 1 of 1

Input Attributes in Shell Scripts

PostPosted: Thu Jan 10, 2019 5:40 am
by Robert
I am a total noob with scripting – but learned a lot in the last three weeks since I got Hazel: and I really love how it works with Hazel and what it can do. Just for my understanding: is there a reason why you cannot inputAttributes in shell scripts like $1, $2, $3?
In some cases that would be really lovely to have. For example in adding different metadata to files with shell script.

Re: Input Attributes in Shell Scripts

PostPosted: Thu Jan 10, 2019 11:33 am
by Mr_Noodle
That would work for textual attributes but not for date ones, I would need to standardize on a specific date format which might be tedious to parse as I'd need to include everything about the date including timezone. I guess I could let the user specify that but then that's extra UI.

Output attributes are the real problem as shellscripts do not have a good channel to transmit that back (they can only return a numerical code). So I'd would probably have to do a whole different UI for input attributes for shellscript than AppleScripts.

Re: Input Attributes in Shell Scripts

PostPosted: Mon Jan 14, 2019 8:46 pm
by Robert
Mr_Noodle wrote:That would work for textual attributes but not for date ones, I would need to standardize on a specific date format which might be tedious to parse as I'd need to include everything about the date including timezone. I guess I could let the user specify that but then that's extra UI.

Output attributes are the real problem as shellscripts do not have a good channel to transmit that back (they can only return a numerical code). So I'd would probably have to do a whole different UI for input attributes for shellscript than AppleScripts.


Thank you for the clarification and the great support on this forum (and of course for Hazel, which is amazing!).