Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tucker28

macrumors member
Original poster
Mar 4, 2012
41
18
That seems to be working. Here are some things I noticed.

Each time it ran, the individual files would go back and forth from "was not found in the logfile" to "has not finished downloading".

I looked through the log file and noticed the files keep showing up as Resilio Sync does its thing. If each file is in both ends of the sync, it doesn't sync them, but each file still shows up in the log... a lot. I think that's why it keeps flipping between the two alerts.

'Finished downloading file "/Users/scott/Library/Application Support/Resilio Sync/' shows up a lot, but not near as often as all the different filenames when the app does it's syncing. It shows up only when the info.dat files change, it seems.

However, 'Finished downloading file "/Users/scott/Downloads/' only shows up twice per file. One for the file itself and once for the file's metadata. /Users/scott/Downloads folder was the one I used for my tests.
For example:
Finished downloading file "/Users/scott/Downloads/movie.m4v"
Finished downloading file "/Users/scott/Downloads/movie.m4v/com.apple.metadata:_kMDItemUserTags"

That got me to thinking. If the two loops were reversed and it looked for /Users/scott/Downloads/ first, and then when that shows up, look for the filename second, it seems like the two loops would get fewer hits and run quicker. I can read the code and tell what it's doing, and I think I could do that on my own once I got used to the syntax AppleScript uses. But the 'set theLogSearchResult' line is going to take me quite a while to figure out. I know what it's doing, but there's a lot in that line that I'm not familiar with.

Also, I see what you mean about setting the file paths in the final script, but what about when it's on a separate drive?

Would it be "Working:Foldername" or "Macintosh HD:Volumes:Working:Foldername"?

Thanks for everything you're helping me with. Not only are you helping me with this issue, you're giving me some insights into the language that will help me learn it better.
 

AlumaMac

macrumors 6502
Jan 25, 2018
391
734
I just noticed an error in my script.....that is probably giving us wrong results on your end. It was correct for the test log file I was working with.

For the set theLogResult to "Finished Downloading" line at the top of the script, change Downloading to downloading. Grep is case sensitive, so it wasn't finding the lines we wanted.

Sorry about that, can you change it run a test again?

As for the the path question, if your external (physical or network) drive is mounted as "Working", then it would be "Working:Foldername".
 

Tucker28

macrumors member
Original poster
Mar 4, 2012
41
18
Yes, that consistently shown “has not finished downloading” instead of flipping back and forth between. Also, it seemed to run quite a bit faster.

I went ahead and commented out the dialogue boxes and set the absolute path names, and all worked well there.

If I labeled them as Downloaded instead of just red, how would I know what the index was? Or am I best served just leaving it simple?
 

Tucker28

macrumors member
Original poster
Mar 4, 2012
41
18
Yeah. Does that mess things up? I can easily keep it as just red. Hazel will strip it off anyway, so the only use case it matters in is if something went wrong and I could see which ones were marked downloaded. However, as long as I don’t use the red tag for anything else, it serves the same purpose.
 

AlumaMac

macrumors 6502
Jan 25, 2018
391
734
Ok, setting tags outside the default 7 colors is tricky.

We can easily set one of the default colors and they can be renamed if you go into the Finder Preferences > Tags and double-click the color name. Then in the script you can change the 'set label to..' line to the corresponding default reference number (0=none,1=orange,2=red,3=yellow,4=blue,5=purple,6=green,7=gray). Even if you rename the color the reference number stays the same.
 

Tucker28

macrumors member
Original poster
Mar 4, 2012
41
18
Yeah, that’s fine. I’ll just use red like we’ve had so far. No need to make it more complex
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.