I'm using the Automator action "Convert to PDF" from ABBYY FineReader Pro. It just does OCR recognition on a given file and saves the output to a new PDF.
It looks like this:
The issue I'm having is the output folder ("Ausgabe speichern in"). I want to tell Automator, that the full path of the input file is also the desired path of the output file (nice to have: and appends "-ocr" to the filename).
I already found out, that this could be done with the AppleScript snippet, that you see on the bottom of the screenshot. Unfortunately, the files will end up in /Applications, because the ABBYY app is in there and so the variable isn't being interpreted as I wanted it to be.
Any insights and hints will be highly appreciated.