Action on folder size

For my Omnis Studio app I’d like to be able to give my users one click output of PDF reports. This would mean I’d need to be able to supply a file name and path for the PDF and then bypass the print and save as dialogs. Is this possible at all? I’ve read posts here that indicate it might be :?

If it is anyone interested in a small consulting project? :wink:


use keystrokes
something like this:

keystroke "p" using {command}
keystroke enter
keystroke "s" using {command}

You would have to put all of this in a tell statement

tell application "OmniPage Pro"
       tell application "System Events"
             keystroke "p" using {command}
             keystroke enter
             keystroke "s" using {command}
       end tell
end tell

I have been looking for an AppleScript that would do the following…

When you click on a folder it will get the folder size and if it is 4 GBs or larger it will display a message that tells the size of the folder.

The reason for this is so I can backup a folder to DVD when it goes over 4 GB.

I haven’t found any sample code for this and I am not AppleScript saavy enough to create one from scratch.

Any help would be appreciated.

Thank you!

Somthing like this should work.

property alertSize : 4.294967296E+9 -- 4 GB in bytes
on opening folder thisFolder
	tell application "System Events"
		set theSize to the size of thisFolder
		if theSize is greater than or equal to alertSize then display dialog "The folder size has reached or exceeded 4 GB." buttons {"OK"}
	end tell
end opening folder

It’s activated whenever you open the folder you attach it to (can’t do “clicked” with folder actions). Hope this helps.

Hello aleksvolt,

If you use an “on idle” handler instead of a folder action for the above script, it will check and notify automatically for you at intervals which you specify.


Variable as the shade

Instead of an idle handler or on open folder action, both of which will do the job well but…, I’d actually recommend that you use a folder action that checks the size every time you add files to the folder, then you’d know immediately when the limit was reached and you wouldn’t have to have an extra process running in the background 24/7. Meant to recommend this earlier but it slipped my mind when finishing my last post.