Hello Luther,
On Jul 17, 2013, at 2:13 PM, Luther Fuller < email@hidden> wrote: This means that the application (bundle) is self modifying.
Which, in turn, means that use of global variables will interfere with, for example, codesigning and perhaps other security measures used in Lion or Mt Lion.
I see.
These self-modifying apps that Apple's AppleScript Editor makes, isn't Apple breaking its own rules?
I would think that apps shouldn't modify themselves, and that they shouldn't even create files in the same directory as they are running in, that apps should save their state in the following location:
~/Library/Saved Application State/<bundle ID>.savedState
I read recently here on this email list that the new AppleScript Editor in Mountain Lion makes it much easier to specify a bundle ID.
I have two apps, created from the same code:
global_x_1.app and global_x_2.app
global_x_2.app
has all of its files and folders marked as read-only and
global_x_1.app
has all of its folders marked as read / write
At first, global_x_1.app would keep track of the state of x across runs of the program, and the app: global_x_2.app would not.
Then I changed both apps to have a bundle id other than the default, and they both have the global variable x being persistent across runs, but I don't know where the data is going.
is read-only, so the data couldn't be saved within it, and I looked in the folder:
~/Library/Saved Application State/<bundle ID>.savedState
folders do exist there for each app, with a folder name of the bundle ID, but there's nothing there -- not even any invisible files or folders.
So, I'm happy to learn about the persistence of global variables, and to lear about where it appears that apps are supposed to save their state, but I'm still puzzled about how these apps created by AppleScript save their state now -- even when their application bundle is entirely read-only.
|