Re: Selecting every item of one disk's desktop
Re: Selecting every item of one disk's desktop
- Subject: Re: Selecting every item of one disk's desktop
- From: Bill Peters <email@hidden>
- Date: Mon, 26 Feb 2001 10:09:18 -0700
It will probably be easier to use ToolServer to accomplish what you want.
In my relatively few experiments, AppleScript merges all of the Destop
Folders of each mounted volume, making it hard to see which item belongs to
what disk.
ToolServer is a stripped down version of the MPW Shell that exists solely
to run MPW Shell scripts. The MPW suite is available from Apple as a free
download from the following URL:
<
http://developer.apple.com/tools/mpw-tools/>
The ToolServer application itself is a 476K program, but it is very
powerful. The downside is that you will have to learn yet another scripting
language, but for file and disk manipulation operations it is often the
easiest thing to use.
Here is an example AppleScript (using ToolServer) to do what you want. You
can change the object of the DoScript command to "deletethem" to actually
delete the files rather than moving them to the trash.
-- ---------------------------------------------------------
-- Preprocessed by Convert Script 1.0d4
-- ---------------------------------------------------------
set diskname to "Untitled"
set deletethem to "for f in `files -f \"" & diskname & ":Desktop Folder:\"`
; delete -ay -y \"{f}\" ; end"
set movetotrash to "for f in `files -f \"" & diskname & ":Desktop
Folder:\"` ; move \"{f}\" \"Untitled:Trash:\" ; end"
tell application "ToolServer"
activate
DoScript movetotrash
quit
end tell
-- ---------------------------------------------------------
Note: in case the listserver mangles this, the backquote symbols before
"files" and after "Folder:\" are found above the tab key on US keyboards.
Good Luck,
Bill Peters
>
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