NecrosBlood apprendista
Numero di messaggi : 44 Età : 30 Localizzazione : Ma, più o meno fra Rio de Janeiro e Capo Nord Data d'iscrizione : 06.10.07
| Titolo: AppleScript 2 Sab Feb 02, 2008 2:14 am | |
| Allora, parliamo dei dialogsCon AppleScript si possono fare facilmente Script carini quanto stupidi da aprire al login, naturalmente basati su scelta: Prima di tutto bisogna dare un messaggio - Codice:
-
input to display dialog "set input to display dialog "gdfjfrgjrfpejwepfjwepwpj" Poi bisogna aggiungerci una casella di risposta - Codice:
-
default answer "" set answer to text returned of input e poi dargli le risposte che gli piacciono - Codice:
-
if answer is "eh?" then display dialog "CIUPPAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!" end if Ora abbiamo creato: - Spoiler:
- Codice:
-
set input to display dialog "gdfjfrgjrfpejwepfjwepwpj" default answer "" set answer to text returned of input
if answer is "eh?" then display dialog "CIUPPAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!" end if
Che apparirà sullo schermo con due bottoni "annulla" e "ok". Peccato che questo script sia inutile sia per offesa che per comodità. (Però bisogna dire che è un gran script) | |
|
NecrosBlood apprendista
Numero di messaggi : 44 Età : 30 Localizzazione : Ma, più o meno fra Rio de Janeiro e Capo Nord Data d'iscrizione : 06.10.07
| Titolo: Re: AppleScript 2 Sab Feb 02, 2008 1:01 pm | |
| ComoditàSe si è in una famiglia piccola si può fare uno script da aprire al login: - Spoiler:
- Codice:
-
set input to display dialog "Ciao. Chi sei?" buttons {"***", "**", "****"} if the button returned of the input is "***" then set answer to display dialog "Cosa vuoi?" buttons {"Diner Dash", "iTunes", "Mail"} if the button returned of the answer is "Diner Dash" then tell application "Finder" activate open application file "Diner Dash Hometown Hero" of folder "Script Games" of folder "Games" of folder "Applications" of the startup disk end tell else if the button returned of the answer is "iTunes" then tell application "iTunes" to activate else if the button returned of the answer is "Mail" then tell application "Mail" to activate end if else if the button returned of the input is "**" then set answer to display dialog "Cosa vuoi?" buttons {"Safari", "msn", "Games"} if the button returned of the answer is "msn" then tell application "Finder" activate open application file "Microsoft Messenger" of folder "Applications" of the startup disk end tell else if the button returned of the answer is "Safari" then tell application "Finder" activate open application "Safari" of folder "AppleScript" of folder "Applications" of the startup disk end tell else if the button returned of the answer is "Games" then tell application "Finder" activate open folder "Script Games" of folder "Games" of folder "Applications" of the startup disk end tell end if else if the button returned of the input is "****" then set answer to display dialog "Cosa vuoi?" buttons {"Safari", "Photoshop", "Games"} if the button returned of the answer is "Photoshop" then tell application "Finder" activate open application file "Adobe Photoshop" of folder "Applications" of the startup disk end tell else if the button returned of the answer is "Safari" then tell application "Finder" activate open application "Safari" of folder "AppleScript" of folder "Applications" of the startup disk end tell else if the button returned of the answer is "Games" then tell application "Finder" activate open folder "Script Games" of folder "Games" of folder "Applications" of the startup disk end tell end if end if
In questo script abbiamo usato dei buttonsI buttons possono essere massimo tre e sono molto belli e semplici, in più tolgono ok e annulla, che invece da vedere facevano schifo Il problema è che se in questa famiglia ci sono 4 persone bisogna farlo a risposta, che diventa un po' una palla, ma alla fine la lunghezza è quasi la stessa | |
|