Hi
Is it possible to pass the matched file, filename.extension into an embedded script.
My embedded script works if I type the filename.extension. The script needs the filename pass to run.
For example: Embedded script has
cd /Users/fullpathtoPythonScript/
python3 pythonscript.py /Users/fullpath/toINPUTfile/textA\(4\).txt
The folder is a "processing folder". Meaning - once hazel matches the file.txt, runs script on the file.txt, the file.txt will be moved out of processing folder.
The filenames of these input files (matched files) unfortunately will sometimes have brackets which I could only get to work in terminal if I put a backslash in front of the bracket.
I tried using "$1" to indicate the filename, like I had previously done, but it did not work. Error in log, was problem with script.
If it is not possible, should I be thinking differently about this. e.g. once match, rename to a generic name, process script etc... (I have this working as a Hazel rule, but am asking as wanted to make sure I am doing the best solution)
first action: rename
rename file (replace ( with A and replace ) withB)
next action: embedded script
cd /Users/fullpathtoPythonScript/
python3 pythonscript.py "$1"
Thankyou for your time and assistance.
Kind regards