When using singletons like NSFileManager.default() and NSWorkspace.shared(), is there any reason I shouldn’t do this in the property declaration:
property FileManager : a reference to current application's NSFileManager's defaultManager
As opposed to this:
property NSFileManager : a reference to current application's NSFileManager
set fileManager to NSFileManager's defaultManager()
I note that you can’t add the parens to defaultManager if you include it in the property declaration, and I recall some warnings about omitting those, but unsure whether those would come in to play here.
I’m normally nervous about leaving off parentheses, but I can’t see that problem here. Not that I say that with total confidence.
One thing I do notice, though, is this:
use framework "Foundation"
property fileManager : a reference to current application's NSFileManager's defaultManager
fileManager
--> defaultManager of NSFileManager
The variable doesn’t contain the pointer, so it presumably has to be resolved each time it occurs. In AEPrint it looks like this: