• 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: Lion crashed by AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lion crashed by AppleScript


  • Subject: Re: Lion crashed by AppleScript
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 22 Jul 2011 11:58:46 -0500

I just installed Lion on an unused partition and tested the parts of my script. Very revealing!

Here is a handler with notes ...

on showInvisibles()
tell application "Finder"
(path to preferences folder from user domain) as text
set filePath to the result & "com.apple.finder.plist"
quit
end tell
tell application "System Events"
repeat -- until not (exists application process "Finder")
delay 0.1
if not (exists application process "Finder") then exit repeat
end repeat


try
set value of property list item "AppleShowAllFiles" of property list file filePath to true
-- this line fails because the "AppleShowAllFiles" key is not present in a new prefs file.
on error
-- causing this to run.
try
(value of property list file filePath) & {|AppleShowAllFiles|:true}
set value of property list file filePath to the result
-- this successfully adds 'AppleShowAllFiles' to
-- the preference file "com.apple.finder.plist"
-- and Finder immediately becomes inoperative.
end try
end try


end tell
tell application "Finder" to activate
beep
end showInvisibles -----------------------------

When I replaced com.apple.finder.plist with a known good copy from another Lion installation, the problem disappeared.

I have not tried using 'do shell script "defaults ..." ' (yet), but if anyone does, let us know.

In order to see these changes in com.apple.finder.plist, I had to startup in Snow Leopard in order to use Property List Editor 5.3, which will not even launch in Lion. When I design a preferences file for an AppleScripted application, PLE is absolutely necessary in order to see what I am doing.

The absence of PLE in Lion seems odd and may be ominous. 

Also, what is "com.apple.finder.plist.lockfile" ? This is something new in Lion and may have something to do with this problem.

 _______________________________________________
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

References: 
 >Re: Lion crashed by AppleScript (From: Shane Stanley <email@hidden>)
 >Re: Lion crashed by AppleScript (From: Emmanuel LEVY <email@hidden>)
 >Re: Lion crashed by AppleScript (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Lion crashed by AppleScript
  • Next by Date: Re: Lion crashed by AppleScript
  • Previous by thread: Re: Lion crashed by AppleScript
  • Next by thread: Re: Lion crashed by AppleScript
  • Index(es):
    • Date
    • Thread