Home | Presentazione e Curriculum Vitae | Libri Borri | Abbiamo lavorato per...
| Contatti | Consulenze | Articoli | Software download |
| Personal web site - In English |

  

Loading

iChat Status Changer

Come variare in automatico lo status visibile in iChat.

How to change automatically the status visible in iChat



Ero stufo di avere sempre un medesimo messaggio di "status" in iChat, quindi, mi son fatto un piccolo script per variarlo periodicamente. Ho scelto delle frasi simpatiche che variano ogni 10". Siccome sono da leggere consecutivamente per comprendere il discorso, il programma appena parte decide da dove partire e poi le mostra in sequenza.

Come usarlo

Occorre fare partire ScriptEditor (non cercarlo se sei su un PC; esiste solo per Mac, c'è su tutti i Mac. Ma tanto, su PC non avresti iChat, quindi...), poi, copia il codice qui sotto e incollarlo in un nuovo script.

Vanno inserite le frasi nella parte che inizia con:
on inizializeStatusList()

Questa è una funzione che contiene vari comandi. Scrivi la prima frase dove trovi
set StatusList to "MY FIRST STATUS MESSAGE" & return
Inseriscila al posto di MY FIRST STATUS MESSAGE.

Ricorda che ogni frase deve essere compresa tra virgolette!

Per mettere altre frasi, copia e incolla più volte la parte
set StatusList to StatusList & "THE SECOND AND ALL THE REMAINING MESSGES WILL LOOK THIS WAY" & return

Solo l'ultima frase andrà scritta dove trovi
set StatusList to StatusList & "MY LAST STATUS MESSAGE HERE"

A questo punto, registra lo script come programma ricordando di scegliere, come formato documento, "Applicazione" e di contrassegnare la casella "Non uscire".

Quando lo farai partire, se hai fatto tutto correttamente, vedrai cambiare il messaggio di status di iChat ogni 10".

Buon divertimento! :-)

I was tired to see always a static status message in iChat, then, I wrote a script to change it periodically. I chose funny sentences that changes every 10". As they should be read in the proper order to understand some of them, as soon as the program starts, it choose where to start, then it shows the sentences in the order they are written.

How to use it

Start ScriptEditor (don't look for it if you are ona a PC; ScriptEditor is for Mac only, for every Mac. Anyway, on PC there's not iChat, then...), and then copy the code below in a new script window.

Your sentences must be written in the area that starts with:
on inizializeStatusList()

Write the first sentence where you read
set StatusList to "MY FIRST STATUS MESSAGE" & return
Write it instead of MY FIRST STATUS MESSAGE.

REMEMBER: every sentence must be within duoble quotes (")!

To add more sentences, copy and paste several time the part
set StatusList to StatusList & "THE SECOND AND ALL THE REMAINING MESSGES WILL LOOK THIS WAY" & return

The last sentence must be placed where you read
set StatusList to StatusList & "MY LAST STATUS MESSAGE HERE"

Now, save the script as "Application"anc check the checkbox "Stay open".

When you will start the program, if you did everything correctly, you will see your status message in iChat changing every 10"

Enjoy! :-)



on run -- this is called opening the program
    global StatusList, NextStatusParagraph, NumberOfLines
    -- created 3 global variables
    set StatusList to ""
    -- StatusList will contain the list of the status messages
    set NextStatusParagraph to ""
    -- To keep track of the next status message to display
    set NumberOfLines to ""
    -- the total number of paragraps in the list (StatusList)
end run

on idle
    global StatusList, NextStatusParagraph, NumberOfLines
    -- I recall the same global variables
    
    if StatusList = "" then
        -- if StatusList is empty, this mean I must create the list.
        inizializeStatusList()
        -- inizializeStatusList puts all of the status messages
        -- inside the global variable called "StatusList"
        set NumberOfLines to count paragraphs in StatusList
        -- When I created the list of the status messages, I count the lins in it.
        -- This is useful to be able to add/remove status messages
        -- from the list without changing this part of code
        set NextStatusParagraph to random number from 1 to NumberOfLines
        -- Now, I must define wich one will be the first status message to show
    end if
    
    
    tell application "iChat"
        -- The commands to change the status message must be sent to iChat
        set status message to paragraph (NextStatusParagraph) of StatusList
        -- the status shown is the one in the paragraph whose number is contained in "NextStatusParagraph"
        if NextStatusParagraphNumberOfLines then
            -- if I shown the last status (the last paragraph)
            -- the counter indicate a number greater than the
            -- number of paragraph in the list then...
            set NextStatusParagraph to 1
            -- I start from back from the first status message
        else
            set NextStatusParagraph to NextStatusParagraph + 1
            -- otherwise, I set to show the message in the next paragraph
        end if
    end tell
    
    return 10
    -- after 10 econds, I change the message again so I set the delay to "10"
end idle



on inizializeStatusList()
    -- here I create the list of all of my status messages
    global StatusList
    -- First of all, I recall the global variable "StatusList"
    set StatusList to "MY FIRST STATUS MESSAGE" & return
    -- Now the variable "StatusList" contains only two lines of text;
    -- the first one is "MY FIRST STATUS MESSAGE" and a return character
    -- and the second one is empty
    
    set StatusList to StatusList & "THE SECOND AND ALL THE REMAINING MESSGES WILL LOOK THIS WAY" & return
    -- The second and the following line must be created using this code.
    -- This will append the new message in the list after the previous
    
    set StatusList to StatusList & "MY LAST STATUS MESSAGE HERE"
    -- and the last message must ends this way; without a "return" at the end.
end inizializeStatusList



Se questo programma ti è di aiuto e vuoi dimostrare l'apprezzamento all'autore, puoi fare una donazione facendo clic sul pulsante "PayPal".

If you find this program useful, you can make a donation to the author clicking the "payPal" button.