IPB     Il futuro di Tevac dipende da te!  

Benvenuto Visitatore ( Log In | Registrati )

  · · · · · · · · · · · ·
Reply to this topicStart new topic
> [Mail] Etichette
poweruser
messaggio 27 Jul 2006, 17:49
Messaggio #1


MacInATopic
Gruppo icone

Gruppo: Team Moderatori
Messaggi: 24.319
Iscritto il: 27-July 03
Da: Maglie (LE)
Utente Nr.: 440



In Mail è possibile applicare un colore alle mail attraverso le regole. Non è possibile però applicarlo indipendentemente da esse come si fa con le etichette del Finder.
Per ovviare a questo, ecco a voi un semplice script per aggiungere questa funzione.
CITAZIONE
using terms from application "Mail"
     on perform mail action with messages selectedMsgs
          
          -- scegliamo il colore
          set coloreScelto to item 1 of (choose from list {"Blu", "Grigio", "Verde", "Arancione", "Viola", "Rosso", "Giallo", "Nessuno"})
          if coloreScelto is equal to "Blu" then
               set colore to blue
          else if coloreScelto is equal to "Grigio" then
               set colore to gray
          else if coloreScelto is equal to "Verde" then
               set colore to green
          else if coloreScelto is equal to "Arancione" then
               set colore to orange
          else if coloreScelto is equal to "Viola" then
               set colore to purple
          else if coloreScelto is equal to "Rosso" then
               set colore to red
          else if coloreScelto is equal to "Giallo" then
               set colore to yellow
          else if coloreScelto is equal to "Nessuno" then
               set colore to none
          end if
          
          tell application "Mail"
               set selCount to (count of selectedMsgs)
               if selCount is equal to 0 then
                    display dialog "Non ci sono messaggi selezionati!" buttons {"OK"} default button 1 with icon stop
               else
                    repeat with counter from 1 to selCount
                         set msg to item counter of selectedMsgs
                         -- applichiamo il colore
                         set background color of msg to colore
                    end repeat
               end if
          end tell
     end perform mail action with messages
end using terms from

-- If run as an ordinary script, instead of directly from the Scripts
-- menu, it will call the default handler instead.
using terms from application "Mail"
     on run
          tell application "Mail" to set sel to selection
          tell me to perform mail action with messages (sel)
     end run
end using terms from


È sufficiente salvare lo script in ~/Library/Scripts/Applications/Mail/ (se qualche cartella manca basta crearla), selezionare i messaggi da colorare e scegliere lo script dall'apposito menu.

Ciao
Paolo


-------------------------
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]


--------------------
Paolo Portaluri

guru, n: A computer owner who can read the manual.
Go to the top of the page
 
+Quote Post
MacMomo
messaggio 28 Jul 2006, 09:47
Messaggio #2


Level 5/11
*****

Gruppo: Forum User +
Messaggi: 728
Iscritto il: 21-June 05
Da: Ostra Vetere (AN)
Utente Nr.: 3.979



icon_eek.gif Non sapeno neanche di questa funzione.
Grazie dello script!
È davvero molto utile per gestire meglio la posta. icon_biggrin.gif


--------------------
Marco *
MacBook Nero 2.2 GHz Intel Core 2 Duo - 4 GB RAM
Go to the top of the page
 
+Quote Post
fede_dev
messaggio 28 Jul 2006, 11:53
Messaggio #3


macaddict
*******

Gruppo: Team Moderatori
Messaggi: 2.322
Iscritto il: 16-June 04
Da: bologna
Utente Nr.: 2.026



ottima idea! icon_biggrin.gif

Lo piazzo nel menu......

saluti
fede


--------------------
- 1st don't waver... (© woz)
- Atletico tevac '80- apple way as a feet view © fede_dev
- enigmatico
- supporta zio pino & tevac
Go to the top of the page
 
+Quote Post
poweruser
messaggio 28 Jul 2006, 16:49
Messaggio #4


MacInATopic
Gruppo icone

Gruppo: Team Moderatori
Messaggi: 24.319
Iscritto il: 27-July 03
Da: Maglie (LE)
Utente Nr.: 440



Nuova versione con qualche piccola ottimizzazione e riorganizzazione del codice.

CITAZIONE
using terms from application "Mail"
     on perform mail action with messages selectedMsgs
          tell application "Mail"
               set selCount to (count of selectedMsgs)
               if selCount is equal to 0 then
                    display dialog "Non ci sono messaggi selezionati!" buttons {"OK"} default button 1 with icon stop
               else
                    -- scegliamo il colore
                    set colore to my scegliColore()
                    
                    if colore is not false then
                         repeat with counter from 1 to selCount
                              set msg to item counter of selectedMsgs
                              -- applichiamo il colore
                              set background color of msg to colore
                         end repeat
                    end if
               end if
          end tell
     end perform mail action with messages
     
     -- If run as an ordinary script, instead of directly from the Scripts
     -- menu, it will call the default handler instead.
     on run
          tell application "Mail" to set sel to selection
          tell me to perform mail action with messages (sel)
     end run
     
     -- Sceglie il colore dell'etichetta e lo restituisce trasformato da stringa a colore interno di Mail
     -- Se non ne viene selezionato nessuno, restituisce false
     on scegliColore()
          set listaColori to {"Blu", "Grigio", "Verde", "Arancione", "Viola", "Rosso", "Giallo", "Nessuno"}
          set coloreScelto to choose from list listaColori with title "Etichettatore" with prompt "Scegli il colore dell'etichetta" without multiple selections allowed and empty selection allowed
          if coloreScelto is equal to false then
               return false
          end if
          set coloreScelto to the item 1 of coloreScelto
          if coloreScelto is equal to "Blu" then
               return blue
          else if coloreScelto is equal to "Grigio" then
               return gray
          else if coloreScelto is equal to "Verde" then
               return green
          else if coloreScelto is equal to "Arancione" then
               return orange
          else if coloreScelto is equal to "Viola" then
               return purple
          else if coloreScelto is equal to "Rosso" then
               return red
          else if coloreScelto is equal to "Giallo" then
               return yellow
          else if coloreScelto is equal to "Nessuno" then
               return none
          end if
     end scegliColore
end using terms from


-------------------------
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Ciao
Paolo


--------------------
Paolo Portaluri

guru, n: A computer owner who can read the manual.
Go to the top of the page
 
+Quote Post
kOoLiNuS
messaggio 28 Jul 2006, 16:55
Messaggio #5


Level 2/11
**

Gruppo: Forum User
Messaggi: 87
Iscritto il: 25-July 06
Da: Bari (provincia)
Utente Nr.: 6.387



Grazie Paolo !
E con questo Mail ha una cosa in meno da invidiare a Thunderbird (il cui unico difetto e' la mancanza di un calendario decente).


--------------------
MacBook (2GHz white) + PowerMac G4 (Quicksilver 2001) + PowerBook Aluminium G4 (1,67GHz low-res) + iPod Shuffle 1G (white) + iPod Classic 80G (black)

kOoLiNuS web life & presence

-
Go to the top of the page
 
+Quote Post
ugo
messaggio 24 Sep 2007, 21:39
Messaggio #6


Level 8/11
********

Gruppo: Team Moderatori
Messaggi: 3.534
Iscritto il: 21-December 03
Da: Aquileia
Utente Nr.: 1.155



sei un genio


PS
questo script vale un altro newton icon_smile.gif


--------------------
Ugo Fonzar da Aquileia - MBP 2.2GHz Core 2 Duo 4GB 250GB 10.5.5 - iMac 24" 2,16GHz 2GB 250GB 10.5.5 - iMac 20" 2,4GHz 4GB 250GB 10.5.5 - iPod 5,5G Black 80GB - iPhone 3G 16GB 2.1 - Canon EOS400D
Poi furono gloriosi e indimenticabili: Titanium 15" 667MHz - iPod 4G 20GB - Newton 2000
Sito di lavoro: http://www.studiofonzar.com/
Blog: http://www.studiofonzar.com/blog/
Forum: http://www.studiofonzar.com/forum/
Sito personale: http://www.fonzar.com/
Go to the top of the page
 
+Quote Post
poweruser
messaggio 24 Sep 2007, 21:44
Messaggio #7


MacInATopic
Gruppo icone

Gruppo: Team Moderatori
Messaggi: 24.319
Iscritto il: 27-July 03
Da: Maglie (LE)
Utente Nr.: 440



CITAZIONE(ugo @ 24 Sep 2007, 21:39) *
questo script vale un altro newton icon_smile.gif
Il Newton ce l'ho già, si potrebbe avere un iPhone? icon_lol.gif

Ciao
Paolo


--------------------
Paolo Portaluri

guru, n: A computer owner who can read the manual.
Go to the top of the page
 
+Quote Post
ugo
messaggio 24 Sep 2007, 23:01
Messaggio #8


Level 8/11
********

Gruppo: Team Moderatori
Messaggi: 3.534
Iscritto il: 21-December 03
Da: Aquileia
Utente Nr.: 1.155



icon_lol.gif
spetta che arrivino in italia e poi che ne faccia scorta di uno di riserva e che poi abbia bisogno di una superconsulenza da te ...

icon_lol.gif


--------------------
Ugo Fonzar da Aquileia - MBP 2.2GHz Core 2 Duo 4GB 250GB 10.5.5 - iMac 24" 2,16GHz 2GB 250GB 10.5.5 - iMac 20" 2,4GHz 4GB 250GB 10.5.5 - iPod 5,5G Black 80GB - iPhone 3G 16GB 2.1 - Canon EOS400D
Poi furono gloriosi e indimenticabili: Titanium 15" 667MHz - iPod 4G 20GB - Newton 2000
Sito di lavoro: http://www.studiofonzar.com/
Blog: http://www.studiofonzar.com/blog/
Forum: http://www.studiofonzar.com/forum/
Sito personale: http://www.fonzar.com/
Go to the top of the page
 
+Quote Post
vocenarrante
messaggio 14 Jan 2008, 16:21
Messaggio #9


Level 1/11
*

Gruppo: Forum User
Messaggi: 45
Iscritto il: 14-October 04
Da: roma
Utente Nr.: 2.506



Che SanBit si prenda lungamente cura di voi
Che Santa Mela vi tenga sempre nella sua luce e al riparo dai vermus

questo script è una salvezza!

Ve vojo bene! icon_wink.gif

Marco


--------------------
Marco - PB - Honda Transalp
________________________
Go to the top of the page
 
+Quote Post
kOoLiNuS
messaggio 25 Mar 2008, 15:34
Messaggio #10


Level 2/11
**

Gruppo: Forum User
Messaggi: 87
Iscritto il: 25-July 06
Da: Bari (provincia)
Utente Nr.: 6.387



ma va anche/ancora con Mail.app 3.2 (919/919.2) in dotazione con Leoponz ???

se si sempre nello stesso path va installato ? Grazie!


--------------------
MacBook (2GHz white) + PowerMac G4 (Quicksilver 2001) + PowerBook Aluminium G4 (1,67GHz low-res) + iPod Shuffle 1G (white) + iPod Classic 80G (black)

kOoLiNuS web life & presence

-
Go to the top of the page
 
+Quote Post
poweruser
messaggio 26 Mar 2008, 01:48
Messaggio #11


MacInATopic
Gruppo icone

Gruppo: Team Moderatori
Messaggi: 24.319
Iscritto il: 27-July 03
Da: Maglie (LE)
Utente Nr.: 440



CITAZIONE(kOoLiNuS @ 25 Mar 2008, 14:34) *
ma va anche/ancora con Mail.app 3.2 (919/919.2) in dotazione con Leoponz ???

se si sempre nello stesso path va installato ? Grazie!
Sì, tutto uguale.

Ciao
Paolo


--------------------
Paolo Portaluri

guru, n: A computer owner who can read the manual.
Go to the top of the page
 
+Quote Post
kOoLiNuS
messaggio 26 Mar 2008, 10:47
Messaggio #12


Level 2/11
**

Gruppo: Forum User
Messaggi: 87
Iscritto il: 25-July 06
Da: Bari (provincia)
Utente Nr.: 6.387



CITAZIONE(poweruser @ 26 Mar 2008, 00:48) *
CITAZIONE(kOoLiNuS @ 25 Mar 2008, 14:34) *
ma va anche/ancora con Mail.app 3.2 (919/919.2) in dotazione con Leoponz ???

se si sempre nello stesso path va installato ? Grazie!
Sì, tutto uguale.

Ciao
Paolo


graSSie icon_biggrin.gif


--------------------
MacBook (2GHz white) + PowerMac G4 (Quicksilver 2001) + PowerBook Aluminium G4 (1,67GHz low-res) + iPod Shuffle 1G (white) + iPod Classic 80G (black)

kOoLiNuS web life & presence

-
Go to the top of the page
 
+Quote Post
kOoLiNuS
messaggio 23 Apr 2008, 00:39
Messaggio #13


Level 2/11
**

Gruppo: Forum User
Messaggi: 87
Iscritto il: 25-July 06
Da: Bari (provincia)
Utente Nr.: 6.387



for your pleasure ho dedicato un post sul mio blog allo script aggiungendo due passi nella descrizione e nel come rendere operativo il tutto, colmando alcune "mancanze" non ovvie per chi è a digiuno d