AppleScript Studio - Loading Settings at Launch

I’m looking for a way to load settings at the time an application is launched. I have a Finder preference that I want to load into a variable so that I can display a message to the user on the main window of the application. This message will let the user know the current state (TRUE or FALSE) of the setting.

  1. How can I do things with an AppleScript Studio application at launch? I’ve never done this before. All my previous apps have required the user to act on a button, or some other interface element, before doing anything.

  2. How can I change the Title property of an NSTextField element based on a current variable (which will be populated after I know how to do so at launch - see #1 above).

  3. Once the user knows the current state of the variable, s/he can change that value, which will change the value of the Finder preference (com.apple.finder). I want to be able to change the Title property of the NSTextField if the user changes the value of the preference (FALSE to TRUE, or vice versa). How can I do this without relaunching the application (once I get #1 above working)?

Thanks to anyone who can help me out. I really appreciate it. This seems very simple, but I cannot find anything on it easily and thought I should ask here.

This thread belongs in the AppleScript Studio forum. This post will be moved.

If you haven’t already found found a solution, using Cocoa bindings may help with some of what you’re trying to do. Somewhere in the archives, there’s a link to a discussion about this. Try doing a search for “Cocoa bindings”

Hope that gets you started.
-r

I’m still working on a Cocoa Bindings article.

Hi dmetzcher,

First your script gets the Finder preference and displays it in the text field. Now, did you mean that the user types the new prefernece {true or false) into the text field or that the user changes it manually through the Finder and the text field is automatically updated.

gl,