• 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
System Events vs defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

System Events vs defaults


  • Subject: System Events vs defaults
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 29 Nov 2012 08:49:36 -0600

Recently Dave C asked: "Simple script used to work, not now", which prompted me to carry out some tests in Mt. Lion which I finished yesterday.

Using do shell script "defaults write com.apple.Finder AppleShowAllFiles 0" in Mt. Lion works, but the purpose of my tests was to determine why writing Finder's pref file with System Events does not work and how it can be fixed.

In Lion and previous OS's my script:
1. Quits the Finder;
2. Writes the file "com.apple.finder.plist" via System Events;
3. Reads the changed value to verify the write (testing only);
4. Launches and activates the Finder.
and it works perfectly.

When this script is run in Mt. Lion, it seems to work the first time, then refuses to work at all on repeated runs.
(No errors, it just has no effect.) I finally pause for a minute or so due to frustration and to check my code.
Then I try one more time … and it works! (There seems to be a timing problem.)

I have also tried changing the value of AppleShowAllFiles manually via Xcode and that does not always work.

Something strange seems to be happening with the Finder's prefs file in Mt. Lion.
I have come to the conclusion that using System Events to modify the Finder's prefs file no longer works due to unknown changes introduced in Mt. Lion. Using System Events to modify the prefs file for other applications may also be a problem also. (Using System Events to modify the prefs file for an application you have written seems to be OK.)

Conclusion … System Events does not work with Finder's prefs file and it can not be fixed.


 _______________________________________________
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

  • Prev by Date: Re: Can't make Xcode snapshots for project.
  • Next by Date: How do I save an array in plist?
  • Previous by thread: Re: Can't make Xcode snapshots for project.
  • Next by thread: How do I save an array in plist?
  • Index(es):
    • Date
    • Thread