• 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: Sat, 23 Jul 2011 16:21:38 -0500

I have spent hours this afternoon restarting various startup disks trying to find a cause and fix to this problem. I finally decided to rewrite my Abracapocus application without the idle and quit handlers.
The script, below, does exactly what it's supposed to do without any problems.

There seems to be a problem of some sort with Stay Open applications in Lion. (See my other post "Idle Bug in Lion ASE".) I have no idea what the connection is or why it should cause problems. Stay alert.

on run
display dialog "Set invisibles to …" buttons {"Cancel", "Show", "Hide"} default button 3
button returned of the result
if the result = "Show" then
my toggleInvisibles(true)
else if the result = "Hide" then
my toggleInvisibles(false)
end if
end run -----------------------------------------

on toggleInvisibles(|show|)
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
delay 1
try
set value of property list item "AppleShowAllFiles" of property list file filePath to show
-- this line fails if the "AppleShowAllFiles" key is not present in a new prefs file.
on error
-- causing this to run.
try
value of property list file filePath
the result & {|AppleShowAllFiles|:show}
set value of property list file filePath to the result
-- this adds 'AppleShowAllFiles' to the preference file "com.apple.finder.plist"
end try
end try
delay 1
end tell
tell application "Finder" to activate
end toggleInvisibles -----------------------------

 _______________________________________________
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: Lion crashed by AppleScript
      • From: Shane Stanley <email@hidden>
    • Re: Lion crashed by AppleScript
      • From: KOENIG Yvan <email@hidden>
    • Re: Lion crashed by AppleScript
      • From: Wayne Melrose <email@hidden>
References: 
 >Re: Lion crashed by AppleScript (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Idle Bug in Lion ASE
  • 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