1

I recently purchased PDFScanner to convert a bunch of scans into searchable, smaller-sized PDFs. I specifically picked PDFScanner because of its AppleScript automation (see "Features" section on PDFScanner's website).

enter image description here

However, when I put together the above script using the built-in commands as documented in PDFScanner's AppleScript library and tried to run it, I got the following error:

enter image description here

At this point, I'm stuck. I've contacted the developer. He said this exact same scripts works for him and that I should try to delete and reinstall PDFScanner, which I did to no avail. Can anybody figure out what the problem is?


Here's the complete script:

on run {input, parameters}

    tell application "PDFScanner"
        deskew input
        rasterize input
        ocr input
    end tell

    return input
end run
  • 1
    Copy your script, paste into TextEdit, In TextEdit, go to the Format menu and choose Make Plain text. Select & copy plain text from TextEdit into workflow. Give it a whirl. – IconDaemon Dec 13 '16 at 18:54
  • @IconDaemon Intersting idea, but the problem remains. – Casimir Dec 13 '16 at 18:59
  • If 'input' is a variable you came up with, try changing it to input_file_name or something. Perhaps 'input' is a reserved word in Automator and can't be used as a variable.. – IconDaemon Dec 13 '16 at 19:06
  • @IconDaemon The variable input is in fact preconfigured when adding the "Run AppleScript" action to an Automator workflow. The following construct is added automatically: on run {input, parameters} (* Your script goes here *) return input end run – Casimir Dec 13 '16 at 19:17
  • 1
    Oh, well. Take a look at these links: Apple Support and StackExchange. – IconDaemon Dec 13 '16 at 19:55
0

As it turns out, the cause of the problem was trivial. I simply used the wrong type of (formatted) quotation marks in tell application "PDFScanner". After removing the formatting, everything worked like a charm. This workflow saved me quite some time:

enter image description here

on run {input}

    tell application "PDFScanner"
        repeat with PDF in input
            deskew PDF
            rasterize PDF
            ocr PDF to PDF
        end repeat
    end tell

    return input
end run
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .