Mit "Vanilla AppleScript" ist das machbar aber etwas muehselig - sehr viel einfacher waere es ein AppleScript fuer ein echtes Textprogramm, wie z. B. BBEdit zu schreiben.
Nur mit AS-Bordmitteln ist die Prozedur in etwa folgende:
Code:
tell application "Finder"
set myText to read file [Pfad_zum_Textfile]
end tell
set newText to ""
set countP to count of paragraphs of myText
repeat with i from 1 thru countP
if characters 1 thru 2 of paragraph i of myText = "@t" then
set newText to (newText & (paragraph i of myText) & return)
end if
end repeat
-- jetzt muessten wir in der Variable "newText" alle Zeilen abgespeichert haben, die im Originaltext mit "@t" beginnen
-- Schritt 2: Kreation eines neuen Textes, in dem alle "@t" durch "" ersetzt werden:
set finalText to ""
set countP to count of paragraphs of newText
repeat with j from 1 thru countP
set newLine to (characters 3 thru -1 of (paragraph j of newText) & return)
set finalText to (finalText & newLine)
end repeat
-- Die Variabile "finalText" enthaelt das Resultat der Textoperationen.
-- Du kannst sie in einen neuen File oder ins Clipboard schreiben
Das ganze ist aus dem Stand und auf einer Windose geschrieben - also ohne Gewaehr - einfach mal ausprobieren
Frohes scripten
Farid