Newsgroup: it.comp.macintosh
Titolo: [AS] Posizioni finestre e icone dul desktop

Salve a tutti,
sulla scrivania ho 3 finestre a scomparsa, 3 icone allineate in basso a
sinistra secondo un certo ordine, e quattro (+ il cestino) in basso a
destra.
Capita spesso che quando passo da una risoluzione del monitor all'altra,
compare il messaggio di errore : Il finder non ha memoria a sufficienza
per ristabilire etc...." e zompano tutte le posizioni delle icone e le
finestre a scomparsa compaiono come normali; questo mi succede quando
sono aperte applicazioni che richiedono molta memoria (infatti, con Vpc,
capita l'80 per cento delle volte).
C'e' uno script che puo' ripristinare le posizioni di icone e finestre a
scomparsa personalizzate ???
Grazie.
-- 
Ciao, Cett1
ce...@libero.it
"Considerando l'apertura alare e la frequenza del battito delle ali
rapportate al peso,è scientificamente provato che un coleottero
non sa volare. Vola perchè non lo sa".

 Salve a tutti,
[AUTO CUT]
cacchio, a momenti mi scordavo:
Mac OS 8.6 e iMac 233 rev B


 scomparsa personalizzate ???
Per le finestre a scomparsa non so, ma per tutte le altre posizioni, con
SwitchRes c'e' un elemento dei menu' contestuali che ti fotografa la
scrivania e te la restituisce tale e quale dopo che cambiando
risoluzione le icone si sono spostate.
-- 
nans
per rispondermi togli le mutande


thx!


 risoluzione le icone si sono spostate.
grazie!


 scomparsa personalizzate ???
DIM 1.3, prendi la parte sotto il tratteggio e compilala come
applicazione con lo script editor.
Occhio agli a capo, magari qualcuno saltera'.
desktop icon manager v1.3
G.J. Parker, © 1998-9
------------------------------------------------------------------------
(* set properties *)
property iconsall : {} (* list of all icons on desktop *)
property positionall : {} (* corresponding list of positions of the
icons on desktop *)
property screenSize : {} (* screen size for the previous lists *)
property prompt_p : true (* should user be prompted, or default to just
'Restore'*)
(* something was dragged onto DIM *)
on open x (* get user request *)
        if (count of iconsall) = 0 then (* first time run *)
                firsttime()
        else (* not a first time run *)
                copy "1" to df -- default is to Update
                if prompt_p = true then copy "2" to df -- default is to
Restore
                notfirsttime(df)
        end if
end open
(* DIM was told to run (double-click, automatic, etc.) *)
on run (* get user request *)
        if (count of iconsall) = 0 then (* first time run *)
                firsttime()
        else if prompt_p = true then (* they want to be prompted *)
                notfirsttime("2") -- default is to Restore
        else
                restore()
        end if
end run
on firsttime()
        set request to display dialog "Create icon position database?"
buttons {"Cancel", "Create"} default button "Create"
        if button returned of request is "Create" then update()
end firsttime
on notfirsttime(df)
        copy "Automatically Restore on run
                     (currently Prompted on run)" to x
        if (prompt_p = false) then copy "Prompt when run
                     (currently Automatically Restores)" to x
        copy "Choose option number:
" & ¬
                "               1. Update database
" & ¬
                "               2. Restore icon positions
" & ¬
                "               3. " & x & "
" to y
        set request to display dialog y buttons {"Cancel", "Choose..."}
default button "Choose..." default answer df
        if button returned of request is "Choose..." then -- do the
option they want
                if text returned of request = "1" then -- want to update
                        update()
                else if text returned of request = "2" then -- want to
restore
                        restore()
                else if text returned of request = "3" then
                        copy (not prompt_p) to prompt_p
                        notfirsttime(df)
                else
                        notfirsttime(df)
                end if
        else if button returned of request is not "Cancel" then
                notfirsttime(df)
        end if
end notfirsttime
on update()
        copy (count of iconsall) to numicon
        (* store icon names & positions and screen size *)
        tell application "Finder" (* yeah, delete old info (if any) *)
                copy {} to iconsall
                copy {} to positionall
                copy {} to screenSize
 
                -- new bit from Stéphane Madrau to make it 1.1- much
faster than the block commeted out immediately below
                set iconsall to name of items of desktop
                set positionall to position of items of desktop
                copy the bounds of the desktop's window to the
screenSize (* also store the size of the current desktop *)
                (*              set iconlist to items of desktop (* get
list of ions on the desktop *)
                repeat with i in iconlist (* and store in database *)
                        copy name of i to end of iconsall
                        copy position of i to end of positionall
                end repeat *)
        end tell
 
        -- see if they want to be prompted or not
        if numicon = 0 then
                copy "Prompt" to x
                copy "Automatic" to y
                copy "Prompt or Automatically restore icon positions on
run?" to z
                if prompt_p = true then
                        copy "Automatic" to x
                        copy "Prompt" to y
                end if
                set request to display dialog z buttons {"Cancel", x, y}
default button y
                if button returned of request is x then copy (not
prompt_p) to prompt_p -- switch option
        end if
end update
on restore()
        (* want to restore the icon positions *)
        tell application "Finder"
                copy the bounds of the desktop's window to the
newscreensize (* get new desktop size *)
        end tell
        set newdx to item 1 of newscreensize (* exclude the menu bar,
newdx should equal 0, but ... *)
        set newdy to item 2 of newscreensize
        set xrel to ((item 3 of newscreensize) - newdx) / ((item 3 of
screenSize) - (item 1 of screenSize)) (* horizontal scaling *)
        set yrel to ((item 4 of newscreensize) - newdy) / ((item 4 of
screenSize) - (item 2 of screenSize)) (* vertical scaling *)
        repeat with i from 1 to number of items of iconsall (* for each
icon... *)
                ignoring application responses -- added ignoring segment
implied from Stéphane, since we don't care how the Finder responds
                        (* set icon to new position if it exists,
otherwise punt *)
                        tell application "Finder" to set position of
item (item i of iconsall) of desktop to ¬
                                {newdx + (0.5 + ((item 1 of (item i of
positionall)) - newdx) * xrel) div 1, ¬
                                        newdy + (0.5 + ((item 2 of (item
i of positionall)) - newdy) * yrel) div 1} (* new position *)
                end ignoring
        end repeat
end restore
-- 
Military intelligence is a contradiction in terms