• 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
How to delete extraneous plist files via AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to delete extraneous plist files via AppleScript


  • Subject: How to delete extraneous plist files via AppleScript
  • From: Barry Fass-Holmes <email@hidden>
  • Date: 12 Jan 2011 21:12:53 -0000
  • Date: Wed, 12 Jan 2011 13:12:49 -0800

Hello,

The script below compiles and executes without returning any errors, but does not produce the desired outcome during testing.

The desired outcome is to move extra plist files for the weather widget to the Trash. Such files contain an extra extension consisting of a variable combination of characters and numbers. An example is

widget-com.apple.widget.weather.plist.r2wmTrw

This symptom is discussed at http://discussions.apple.com/thread.jspa?messageID=11616688&#11616688

What have I done improperly in this AppleScript?

-- Get current user's name
tell application "System Events"
set currentUser to (name of current user)
end tell

-- Check downloads folder and move extra weather widget plist files to the trash

tell application "Finder"
try
delete (every file of folder "Preferences" of folder "Library" of currentUser of folder "Users" whose name contains "widget.weather" and name extension is not "plist")
end try
end tell

Before writing the above script, I tried to accomplish the above goal by building an Automator app that included a command that (in turn) included "whose extension is not plist." The resulting app does move extra plist files to the Trash, but it also moves itself to the Trash! I don't understand that behavior!

Thanks in advance,

Barry

 _______________________________________________
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: How to delete extraneous plist files via AppleScript
      • From: KOENIG Yvan <email@hidden>
    • Re: How to delete extraneous plist files via AppleScript
      • From: Axel Luttgens <email@hidden>
    • Re: How to delete extraneous plist files via AppleScript
      • From: AndrĂ© Renault <email@hidden>
  • Prev by Date: Re: Variable names
  • Next by Date: Re: How to delete extraneous plist files via AppleScript
  • Previous by thread: Re: Mount and move
  • Next by thread: Re: How to delete extraneous plist files via AppleScript
  • Index(es):
    • Date
    • Thread