• 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: A simple script.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A simple script.


  • Subject: Re: A simple script.
  • From: "Luis E. Hernandez" <email@hidden>
  • Date: Sat, 11 Oct 2003 11:58:58 -0400

Thanks to Dave and Andrew (and to those about to mail).

Most enlightening comments. Wish my college teachers had been so thorough
and concise.


Truly,

Luis E. Hernandez
A R C H I T E C T

----- Original Message -----
From: "Andrew Oliver" <email@hidden>
To: "Luis E. Hernandez" <email@hidden>; "AppleScript users list"
<email@hidden>
Sent: Saturday, October 11, 2003 12:09 AM
Subject: Re: A simple script.


> Therein lies the problem with recording scripts, especially in the
Finder -
> they're too literal.
>
> To answer your specific question, the script only deletes files because
line
> 5 of the script says 'select files of folder...'.
> Change this line to 'select every item of folder...' and you'll achieve
what
> you want.
>
> However, a more direct, faster and less intrusive version of the script
> would be:
>
> tell application "Finder"
> delete every item of folder "To Print" of startup disk
> empty trash
> end tell
>
> This script will run and delete every item in the folder without having to
> a) open the folder, b) select the items, and c) close the folder window
> afterwards.
>
> Andrew
> :)
>
> On 10/10/03 8:43 PM, "Luis E. Hernandez" <email@hidden> wrote:
>
> > Hi, list.
> >
> >
> > I'm quite new to scripting, so I'd gratefully appreciate the input:
> > I wrote (recorded, rather) a little script that'll keep a folder clean
using
> > AppleScript v.1.1.3 (I'm running OS8.6 on a Mac8100/100) and saved it as
an
> > application. It goes thus, as copied and pasted from Script Editor (line
> > numbers were added here for reference in this post):
> >
> >
> > 1 tell application "Finder"
> > 2 activate
> > 3 select folder "To Print"
> > 4 open selection
> > 5 select files of folder "To Print" of startup disk
> > 6 delete selection
> > 7 empty trash
> > 8 close container window of folder "To Print" of startup disk
> > 9 end tell
> >
> > Now someone on the network starts storing aliases, folders and what have
you
> > in this folder so the app will inevitably leave things other than files
in the
> > folder. My question is: how do you modify line 5 to get it to include
folders,
> > apps, aliases, etc. or just plainly any items for that matter?
> >
> >
> >
> > Thanks!
> >
> > Luis E. Hernandez
> > A R C H I T E C T
> > _______________________________________________
> > 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.
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Re: A simple script. (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Re: How do I format a number or Round a number?
  • Next by Date: X10 Commands
  • Previous by thread: Re: A simple script.
  • Next by thread: changing start up disk
  • Index(es):
    • Date
    • Thread