Re: How to get the number of items in a selected Folder ?
Re: How to get the number of items in a selected Folder ?
- Subject: Re: How to get the number of items in a selected Folder ?
- From: Shane Stanley <email@hidden>
- Date: Fri, 27 Nov 2015 22:24:54 +1100
On 27 Nov 2015, at 9:13 PM, Thomas Fischer <email@hidden> wrote:
>
> I can save the script if I create a fresh copy, but I cannot save the script after recompiling (i.e.: pushing the hammer icon or cmd-K)
Try making a small change (add a space or something) and then re-compiling.
>
> Furthermore, why would a script like this try to save any variable to begin with? There are no global declarations and nobody using this script would expect any variables preserved from an earlier run.
It's not just global variables; it's top-level variables. As to why that happens, you'll have to ask those who designed it that way.
> The solution to avoid top level variables by using something like
>
> tell me to countFolders()
>
> on countFolders()
> …
> end countFolders()
>
> seems rather odd to me for a scripting environment that should be built for usability.
Obviously we need a better solution. Even when saving works because there are no ASObjC top-level values, the fact that non-ASObjC properties persist where they might not when deployed is unhelpful. At this stage all I can say is that it is what it is, and bugreport.apple.com is the place to get heard about it.
But it is complicated by the fact that self-modifying code is really an awful way to save any values anyway, which means it's difficult to consider in isolation. Doing something like ASObjC Explorer does and just not saving any values solves the immediate problem, but the underlying problem of being able to save values another way is inextricably related, and arguably the bigger issue.
> And the total absence (at least in the German version) of any explanation why saving fails is at least annoying.
If you choose save, there should be an explanatory dialog. But there doesn't seem to be one if the problem is triggered by an autosave.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden