Bonsoir,
Je recherche comment faire pour changer la case d'une chaîne de caractères pour la mettre en Capital (la première lettre en majuscule et le reste en minuscule).
Avez-vous une idée ?
Par avance, merci.![]()
Bonsoir,
Je recherche comment faire pour changer la case d'une chaîne de caractères pour la mettre en Capital (la première lettre en majuscule et le reste en minuscule).
Avez-vous une idée ?
Par avance, merci.![]()
La rubrique Mac
Les cours & tutoriels Mac
Critiques de Livres Mac & iOS
FAQ Mac & iOS
________________________________________________________________________
QuickEvent : Prise de rendez-vous rapide pour iPhone/iPad et iPod Touch (AppStore)
Mon Livre sur AppleScript : AppleScript: L'essentiel du langage et de ses applications
Peut être que ce lien peut t'aider : http://macscripter.net/viewtopic.php?pid=41960
oui, j'ai déjà regarder aussi sur ce lien, mais moi j'avais déjà ça à la base :
Idem pour le minuscule.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 on ChangeCase() tell tab view item 4 of tab view 1 of window 1 if the button is "theChangeCase" then set the comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZEEEEIIIAAAAOOOUUUC" set the source_string to "abcdefghijklmnopqrstuvwxyzéèêëîïìàâäàôöòùûüç" else set the comparison_string to "abcdefghijklmnopqrstuvwxyzéèêëîïìàâäàôöòùûüç" set the source_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZEEEEIIIAAAAOOOUUUC" end if set theChange to contents of text field "theResult" set T to "" considering case repeat with thisChar in theChange set x to the offset of thisChar in the comparison_string if x is not 0 then set T to T & character x of the source_string else set T to T & thisChar end if end repeat end considering set contents of text field "theResult" to T set the clipboard to T end tell end ChangeCase
J'aurai voulu l'utiliser pour faire la première Lettre en Maj et le reste en Min.
La rubrique Mac
Les cours & tutoriels Mac
Critiques de Livres Mac & iOS
FAQ Mac & iOS
________________________________________________________________________
QuickEvent : Prise de rendez-vous rapide pour iPhone/iPad et iPod Touch (AppStore)
Mon Livre sur AppleScript : AppleScript: L'essentiel du langage et de ses applications
Partager