• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: global variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: global variables


  • Subject: Re: global variables
  • From: Kaydell Leavitt <email@hidden>
  • Date: Wed, 17 Jul 2013 15:57:10 -0600

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.

global_x_2.app

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.

-- Kaydell
email@hidden
http://learnbymac.com





 _______________________________________________
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

  • Follow-Ups:
    • Re: global variables
      • From: Luther Fuller <email@hidden>
References: 
 >global variables (From: Jim Brandt <email@hidden>)
 >Re: global variables (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: global variables
  • Next by Date: Re: global variables
  • Previous by thread: Re: global variables
  • Next by thread: Re: global variables
  • Index(es):
    • Date
    • Thread