Re: Is it possible to ...?
Re: Is it possible to ...?
- Subject: Re: Is it possible to ...?
- From: Andy Wylie <email@hidden>
- Date: Sat, 30 Mar 2002 11:06:37 +1200
on 30/3/02 9:08 AM, David Groover at email@hidden wrote:
>
This list seems far too busy for simple questions. But it's worth a try.
>
After catching a glimpse of an earlier post about window positions, I
>
realized that it might be possible to use AS to control my desktop
>
clutter. Is it possible to use AS to perform a script, probably on
>
shutdown, that does a command Y on all desktop files and then moves all
>
the remaining files modified today (and not already identified from a
>
list of untouchables, like my drives, etc) either to a folder, know by
>
their creator type (or label), or, if not recognized, move it to a
>
holding folder, but off the desktop?
my "cleanup" does that sort of thing...
property oodbFiles : {"StdLog"} --out of desktop bounds
property trashXY : {680, 26}
property folderDesc : "is a folder"
property hardiskDesc : "hard disk is"
tell application "Finder"
activate
put away (every disk whose ejectable = true)
end tell
try
expel file "ute:" --Akua Sweets : Unmounts disk
on error m number n
end try
gSetDisks()
gSetfolds()
gSetFiles()
--GET n SET disks
--out of desktop bounds
to gSetDisks()
tell application "Finder" to ,
set derDisks to (name of every item of desktop whose description
contains hardiskDesc) & "StdLog" & "Ram Disk"
clap({starter:{500, -24}, xory:"1", spacer:"42", moveThese:derDisks})
end gSetDisks
--GET n SET folders
to gSetfolds()
try
tell application "Finder"
set theFolders to (every item of desktop whose description
contains folderDesc)
set sortedFolders to (sort theFolders by creation date)
set theFolders to {}
repeat with i in sortedFolders --name can be "got" initially
--and loop unecessary if not sorting
tell i to set end of theFolders to it's name
end repeat
end tell
clap({starter:{740, 25}, xory:"2", spacer:"48",
moveThese:theFolders's reverse})
on error m number n
error {n, m}
end try
end gSetfolds
--GET n SET files
to gSetFiles()
try
tell application "Finder"
set derFiles to (files of desktop whose name is not in
oodbFiles)
set sortedFiles to (sort derFiles by creation date)
set derFiles to {}
repeat with i in sortedFiles
tell i to set end of derFiles to it's name
end repeat
end tell
clap({starter:{640, 40}, xory:"2", spacer:"48", moveThese:derFiles})
on error
end try
end gSetFiles
clap({starter:trashXY, xory:1, spacer:1, moveThese:{" "}}) --Move
Trash--" " = my trash name
on clap(foo)
set {starter, xory, spacer, moveThese} to foo's {starter, xory, spacer,
moveThese}
set cnt to 1
repeat with i in moveThese
try
--new column (12 or more folders will mess it up)
if cnt is in {12, 22} then set starter to {(starter's item 1) -
120, 44}
--
tell application "Finder" to ,
tell desktop to set position of it's item named i to starter
set x to item xory of starter
set {item xory of starter, cnt} to {x + spacer, cnt + 1}
on error m number n
error {n, m}
end try
end repeat
end clap
--thanks to Arthur Knapp____ Andy
_______________________________________________
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.