• 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: Selecting every item of one disk's desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting every item of one disk's desktop


  • Subject: Re: Selecting every item of one disk's desktop
  • From: N!kke <email@hidden>
  • Date: Mon, 26 Feb 2001 19:57:04 +0100

Hej Jeremy,

I use this little applet for cleaning up my desktop now and again. Something
that isn't as easy as it might seem when you have 5 partitions.

It basically moves every item in the desktop folder to a folder on the root
level of each mounted hard drive. When finished it moves the temp-folder of
each hard drive back to the desktop.
Enjoy:

on run
tell application "Finder"
set theFolders to {} as list
set theDisks to list disks
repeat with x in theDisks
set lockedDisk to false
set theItems to list folder (x & ":desktop folder")
if theItems  {} then
set newName to x & " Desktop"
if the number of items of (newName as text) > 31 then set
newName to items 1 through 27 of (newName as text)
if not (exists folder (x & ":" & newName)) then
try
make new folder at disk (x & ":") with properties
{name:(newName as text)}
on error x
display dialog (x & "
This seems to be a CD or some other kind of locked medium.") as text buttons
{"OK"}
set lockedDisk to true
end try
end if
if not lockedDisk then
set theFolders to theFolders & (x & ":" & newName) as
list
repeat with y in theItems
try
move alias (x & ":desktop folder:" & y) to
folder (x & ":" & newName)
end try
end repeat
end if
end if
end repeat
repeat with z in theFolders
move alias ((z as text) & ":") to desktop
end repeat
end tell
end run

Cheers,
Nikke Lindqvist

---------------------
Nikke Lindqvist
http://www.lindqvist.com
http://vinguiden.com
http://cocktailguiden.com

> Fren: Jeremy Reichman <email@hidden>
> Datum: Mon, 26 Feb 2001 08:19:41 -0500
> Till: email@hidden
> Dmne: Selecting every item of one disk's desktop
>
> I'm trying to select every item of one disk's desktop. I have a specific
> reason why I'm trying to delete items from that hidden folder on a
> particular disk.
>
> I've attempted to "select every item of the desktop of disk x" and that
> hasn't done what I wanted. I've tried looping through every item of the
> desktop, trying to see if an item's parent is the desktop folder, but my
> script doesn't seem to work. I don't have my code snippets on me or I'd post
> them for interpretation/critique here.
>
> I'm wondering if anyone has any ideas on how I might go about this ... TIA!
>
> BTW, the ultimate goal is that I want to delete items from a specific disk's
> desktop, keeping those items on other disk(s)' desktop(s), so I can clean up
> a disk for disk imaging with Apple Software Restore.
>
>
> --
> Jeremy Reichman, aka "Jaharmi"
> Software Specialist III (Mac OS) / Instructor
> Customer Support Services
> Information and Technology Services
> Rochester Institute of Technology
> Rochester, New York, USA
>
> World Wide Web <http://www.rit.edu/~jjracc/>
> Electronic mail <mailto:email@hidden>
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users


References: 
 >Selecting every item of one disk's desktop (From: Jeremy Reichman <email@hidden>)

  • Prev by Date: Scripting icon copying: Finder barfs - howcome?
  • Next by Date: Re: Applet's last command doesn't take
  • Previous by thread: Re: Selecting every item of one disk's desktop
  • Next by thread: Re: Selecting every item of one disk's desktop
  • Index(es):
    • Date
    • Thread