type4me blafasel
Beschreibung
Das Skript liest aus einer simplen Text Datei jede Zeil aus und bietet diese in einer Liste zur Auswahl an und dazu noch das aktuelle Datum (WOW!;)).
Der Ausgewählte Text wird dann in der Anwendung, die sichim Vordergrund befindet eingegeben. Schnell, einfach und funktioniert so gut wie jedem Programm, das eine Texteingabe hat.
So können öfter verwendete Textpassagen, schnell und fehlerfrei eingegeben werden
Und wie?
Mit AppleScript und es geht nicht über die Zwischenablage, sondern über keystroke commandos. Das besondere daran ist in erster Linie, dass auch Umlaute damit eingegeben werden können.
Danksagung
Apple , iScript und nicht zuletzte Tom Müller-Korthkamp, ohne den ich das Wort blafasel wahrscheinlich nie kennen gelernt hätte.
Installation und Demo Video
Ich habe das Scripting Menü bei mir aktiviert, so kann ich das Script aus jeder Anwendung heraus starten.
Demo Video
Download
Downloaded a total of 25 times
Aktueller Quellcode
(**© hubionmac.com
Version 1.0
this script types for you some text in the frontmost app
using keystroke applescript commands
the texts you can choose are stored in a text files in ~/Documents/type4me_blafasel.txt
Release info
04.10.2008 Version 1.0 (first release)
**)
set prefFile to (do shell script "echo $HOME") & "/Documents/type4me_blafasel.txt" as text
set cmd to "if test -e '" & prefFile & "' ; then echo 0 ; else echo 1 ; fi"
set firstrun to ((do shell script cmd) as integer) as boolean
if firstrun = false then
set texts to every paragraph of (do shell script "cat " & quoted form of prefFile)
set contains_umlauts to false
set current_date to do shell script "date \"+%d.%m.%Y\""
set text_list to {current_date} & texts
set umlauts to {"ü", "ä", "ö", "Ä", "Ü", "Ö"}
activate me
set t to (choose from list text_list) as text
if t ≠ "false" then
repeat with umlaut in umlauts
if t contains umlaut then
set contains_umlauts to true
end if
end repeat
tell application (path to frontmost application as text)
activate
tell application "System Events"
if contains_umlauts = false then
keystroke t
else
repeat with c in t
if c is not in umlauts then
keystroke c
else
if (ASCII number of c) = 159 then
keystroke "u" using option down
keystroke "u"
else if (ASCII number of c) = 134 then
keystroke "u" using option down
keystroke "u" using shift down
else if (ASCII number of c) = 138 then
keystroke "u" using option down
keystroke "a"
else if (ASCII number of c) = 128 then
keystroke "u" using option down
keystroke "a" using shift down
else if (ASCII number of c) = 154 then
keystroke "u" using option down
keystroke "o"
else if (ASCII number of c) = 130 then
keystroke "u" using option down
keystroke "o" using shift down
end if
end if
end repeat
end if
end tell
end tell
end if
else
set default_text to "Blafasel Text 1
Blafasel Text 2
Copyright hubionmac.com"
do shell script "echo " & quoted form of default_text & "|cat> " & quoted form of prefFile & "; open " & quoted form of prefFile
tell me to activate
display dialog "Text-Vorgaben einfach in die gerade erstelle Text-Datei schreiben. Und das Skript dann neu starten."
end if
Comments
Pingback from hubionmac.com » Aktuelles Tastatur via AppleScript Layout auslesen
Time October 6, 2008 at 11:14 pm
[...] habe das Problem, dass das type4me blafasel-Skript aktuell nur richtig mit der deutschen und englischen Tastatur-Belegung funktioniert. Bei der [...]

Pingback from hubionmac.com » Textschnippsel automatisch einfügen
Time October 4, 2008 at 1:15 am
[...] ein Problem darzustellen). Nun, AppleScript scheint auch hier ein Lösung parat zu haben und so ist type4me blafasel entstanden. Damit lassen sich ausgewählte Text-Schnippsel aus einer Text Datei in so gut wie jedem [...]