"Watched folder" and selecting file for processing in 3rd party app

Thanks rob. To get to that folder in Terminal I have to \ out the space in My Drive. When I do that and then enter pwd -- the result is /Users/u8008006/Library/CloudStorage/GoogleDrive-aaron.timoshanko@gmail.com/My Drive/ScannerPro (with a space in My Drive).

Should I put %Variable%Var_location% in between " " to handle the space in My Drive?

You already have it in quotes in the shell command. What happens if you try the du command in Terminal, with the full path and everything? Put the path in quotes.

-rob.

1 Like

When I enter du -s "/Users/u8008006/Library/CloudStorage/GoogleDrive-aaron.timoshanko@gmail.com/My Drive/ScannerPro/Scan 15 Jul 2024 at 8.06 PM.pdf" | egrep -Eo '\d+\t' in Terminal, I get the result '72696'.

I see the problem, I think:

That's in red because it's not allowed—you don't need the KMVAR bits in the variable name, and unless I'm missing something, you don't need that variable at all.

Just change the Shell Script action to use the variable you created at the start:

du "$KMVAR_Var_location"....

The $KMVAR bit is only needed in shell script actions; it's not part of the variable's name inside the macro itself.

-rob.

1 Like

Thanks rob - we are getting closer. For some reason, the 'loop until filesize is no longer changing' does not seem to be working.

When I drop a scan into the ScannerPro folder, you can see from this screencast the 'display progress' briefly appears in the top left of the screen and then Readiris opens but before the download has finished.

Screen Recording 2024-07-16 at 11.35.57 AM

This is the latest version of the macro I am working with:

OCR scan and compress pdf copy.kmmacros (8.5 KB)

Thanks for your continued help with this.

I don't see anything obviously wrong. I'd try putting a Display Text action in the loop to display the old size and new size variables—maybe change the wait from 0.3 seconds to 2 seconds, just so you don't flood the screen with 5000 messages.

Do the values change?

-rob.

With the current version (see below), even at 0.3 seconds, I only get two display boxes appearing (displaying the Old and New values) and they are always the same...

But I can see in the Finder window that the file is still uploading.

You're still using Google Drive for this. We can't tell from your screen shot what your settings are, but if you aren't set to sync everything then you'll only get a stub file in your local folder (until you actually open the file on the local machine). That file will have a small, set, size, so @griffman's check won't work.

Cloud services can also do funky things with file size reporting -- it may be it's returning the "expected" size if you did download it which, again, will be fixed and not useful as a progress monitor.

How you get round this will depend on your workflow. Why not just use the 5 minute pause, since that's been shown to work? If you need to get things done more quickly, where is the file coming from? If you are doing the initial capture on your local machine you'd be much better off changing things so that you capture to a local folder, process using that local file, and then (if you must have these things in the cloud) copy both the initial capture and the processed result to the Google Drive folder.

2 Likes

I'd totally forgotten about the Google drive aspect, and I think @Nige_S is spot on: That will definitely cause issues, so either go back to the five-minute pause and get a coffee :), or save locally first, process, then upload to Google drive. (That's probably the route I'd take, just because I much prefer to process stuff locally before uploading to a server.)

Thanks, @Nige_S for pointing out the obvious that I'd overlooked!

-rob.

1 Like

Thank you to you both for your help! That makes sense - learnt a lot through the process. Thanks again!