Aktuelle Zeit: 28. März 2024 13:06

Alle Zeiten sind UTC + 1 Stunde




 Seite 1 von 1 [ 1 Beitrag ] 
Autor Nachricht
 Betreff des Beitrags: Office Shift+F3 Imitation
BeitragVerfasst: 18. März 2008 14:17 
Administrator
Benutzeravatar

Registriert: 17. März 2008 13:32
Beiträge: 96
Wohnort: NRW, Germany
;;
;; Paste it to your remote and it will work like Microsoft Office Shift+F3 (it only handles spaces currently)
;; Converts the selected word from "Word" to "WORD" to "word" to "Word"
;;
;; Contact me @ Sephiroth@leech-world.de if you have some questions or suggestions
;;
; using Shift+F3 cuz it's the same in MS Office
alias sf3 {
  ; Get the active line
  var %line = $editbox($active)
  ; Where is the cursor? Is he hiding? :>
  var %x = $editbox($active).selstart
  ; What position in the sentence has the word?
  var %n = $findword($editbox($active),%x).num
  ; And the word under the cursor is:
  var %word = $findword($editbox($active),%x)
  ; how does it look when it's lowercase?
  var %lower = $replacecs($lower(%word),Ä,ä,Ö,ö,Ü,ü,À,à,Á,á,Â,â,Ã,ã,Å,å,Æ,æ,Ç,ç,È,è,É,é,Ê,ê,Ë,ë,Ì,ì,Í,í,Î,î,Ï,ï,Ñ,ñ,Ò,ò,Ó,ó,Ô,ô,Õ,õ,Ø,ø,Ù,ù,Ú,ú,Û,û,Ü,ü,Ý,ý)
  ; how does it look when it's uppercase?
  var %upper = $replacecs($upper(%word),ý,Ý,ü,Ü,û,Û,ú,Ú,ù,Ù,ø,Ø,õ,Õ,ô,Ô,ó,Ó,ò,Ò,ñ,Ñ,ï,Ï,î,Î,í,Í,ì,Ì,ë,Ë,ê,Ê,é,É,è,È,ç,Ç,æ,Æ,å,Å,ã,Ã,â,Â,á,Á,à,À,ü,Ü,ö,Ö,ä,Ä)
  ; how does it look when the first letter is a capital letter?
  var %fupper = $left(%upper,1) $+ $right(%lower,-1)
  ; What is the word? I want to change it! (changes smilys like ":D" ONLY to ":d")
  if (%word === %lower) { %word = %fupper }
  elseif (%word === %fupper) { %word = %upper }
  else { %word = %lower }
  ;Get the parts before and after this word cuz $reptok and so sucks ;>
  if (%n != 1) var %before = $gettok(%line,1- $+ $calc(%n -1),32)
  if (%n != $numtok(%line,32)) var %after = $gettok(%line,$calc(%n +1) $+ -,32)
  ; Build a new sentence
  %line = %before %word %after
  ; Now paste the shit back to the editbox and edit the word
  editbox -b $+ %x $+ e $+ %x %line
}
; This little alias helps me finding the word, i don't want to describe it so much
alias -l findword {
  var %x = $1,%s
  %s = $numtok($left(%x,$2),32)
  if ($prop = num) return %s
  %s = $gettok(%x,%s,32)
  return %s
}



_________________
one step closer to world domination
Cyberscripters Administrator/Founder
   
 
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
 Seite 1 von 1 [ 1 Beitrag ] 

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  

cron