• 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: 9.2.2 Delete everything in folder except for these items?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 9.2.2 Delete everything in folder except for these items?


  • Subject: Re: 9.2.2 Delete everything in folder except for these items?
  • From: Kai <email@hidden>
  • Date: Fri, 31 Jan 2003 22:42:14 +0000

on Fri, 31 Jan 2003 07:29:23 -0500, Dan Ball <email@hidden>
wrote:

> I need some help! I'm trying to write an AppleScript for OS 9.2.2 with
> Apple's Script Editor 1.7.
>
> Here is what I want to do:
>
> I want the script to go in the "Launcher Items folder" and delete everything
> in there except for these alias's (Dreamweaver 4, Illustra8.0.1,
> Illustr9.0.2, ImageReady 3.0.1, MS Exel, MS PowerPoint, MS Word, PageMaker
> 6.5, Photoshop 6, QuarkXPress 4.11, Suitcase 9)
>
> How can I accomplish this?? I'm a fairly new to this also so please be
> gentle!!

You should be able to accomplish this in a single (if lengthy) line, Dan:

==============================================

tell application "Finder" to delete [NO BREAK]
((path to launcher items folder)'s alias files [NO BREAK]
whose name is not in {"Dreamweaver 4", [NO BREAK]
"Illustra8.0.1", "Illustr9.0.2", "ImageReady 3.0.1", [NO BREAK]
"MS Exel", "MS PowerPoint", "MS Word", [NO BREAK]
"PageMaker 6.5", "Photoshop 6", "QuarkXPress 4.11", "Suitcase 9"})

==============================================

(Hope that's gentle enough.)

BTW, if you're running AppleScript 1.7, you may want to consider upgrading
to AS 1.8.3, which can be downloaded from Apple. (AS 1.7 is considered to be
rather buggy - especially in relation to the parsing of file paths.) This
should get you close to the 1.8.3 download:

http://kbase.info.apple.com/cgi-bin/WebObjects/kbase.woa/wa/query?val=+apple
script+1.8.3&type=downloads&nodes=&dateModified=&geography=&type=smartSearch
&nodes=&dateModified=&geography=

--
Kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Running AppleScript code from the Terminal?
  • Next by Date: Trouble building app in Applescript Studio.
  • Previous by thread: Re: 9.2.2 Delete everything in folder except for these items?
  • Next by thread: Calling applications
  • Index(es):
    • Date
    • Thread