• 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: .plist dilemma
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .plist dilemma


  • Subject: Re: .plist dilemma
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 16 May 2015 21:51:58 +1000


Sorry Shane

I have a tick box that the value of is bound to the variable ‘automaticallyEmptyTrash’.

I have also registered a default defaults's registerDefaults:{autoEmptytrash:false}

I have then tried to set the variable  ‘automaticallyEmptyTrash’ to the default with…

set automaticallyEmptyTrash to defaults's objectForKey:"autoEmptytrash"

I can set the default with the handler on saveThePrefs:{} using…

tell defaults to setObject:automaticallyEmptyTrash forKey:"autoEmptytrash"
 I added the following to the line I’m working with. ‘Say 1’ DID work, and automaticallyEmptyTrash  said ‘false’, so the so the default is being read, but the tick box does not alter its state to reflect the altered state of the variable, it’s always ticked (true). I think there’s something wrong with my approach to ALL the 'set to defaults’s’ lines, but I don’t know what. I thought tick boxes and display fields with numbers would update with the variables read from ‘defaults’s’.

Should I Perhaps have a ‘my’ in front of the variables? I did try that, but it did not seem to work.

However, this one 'set’, and ONLY this one, works.

try
set p to 7
set tempMailManagerDesktopFolderPath to defaults's objectForKey:"mailManagerDesktopFolderPathArchive"
tell application "Finder"
try
set my mailManagerDesktopFolderPath to (tempMailManagerDesktopFolderPath as text) as alias as text
end try
end tell
end try
Regards

Santa

say 1
try
set automaticallyEmptyTrash to defaults's objectForKey:"autoEmptytrash"
say 2
say automaticallyEmptyTrash as text —< false, but bound to value tick box is ‘true'
say 3
on error
say "error in setting trash empty default"
set my automaticallyEmptyTrash to true
end try


 
On 16 May 2015, at 9:13 pm, Shane Stanley <email@hidden> wrote:

On 16 May 2015, at 8:28 pm, Brian Christmas <email@hidden> wrote:

Values that I set in the Application are being written to the .plist correctly, through ‘defaults’, but values that I try and set are being ignored, and are falling back to the set ‘properties’ for each variable.

I can't make any sense of that, I'm afraid.

For example, a tick box that has a .plist entry

Checkboxes don't have .plist entries.

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: .plist dilemma
      • From: Shane Stanley <email@hidden>
References: 
 >.plist dilemma (From: Brian Christmas <email@hidden>)
 >Re: .plist dilemma (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: .plist dilemma
  • Next by Date: Re: .plist dilemma
  • Previous by thread: Re: .plist dilemma
  • Next by thread: Re: .plist dilemma
  • Index(es):
    • Date
    • Thread