MilchKaffee
Aktives Mitglied
Thread Starter
- Dabei seit
- 19.01.2006
- Beiträge
- 797
- Reaktionspunkte
- 3
Hallo,
ich habe ein Applescript geschrieben, welches eine Textdatei in Textedit aufruft und darin alle Kommata gegen Semikola austauschen soll. Zusätzlich soll es auch alle Anführungsstriche rauslöschen.
Das Ganze sieht so aus:
Relativ easy also.
Aber: Wie realisiert man das autoamtische Abspeichern der Datei "test.txt" via Script und wie schliesst man Textedit wieder?
Danke für Hilfe!
ich habe ein Applescript geschrieben, welches eine Textdatei in Textedit aufruft und darin alle Kommata gegen Semikola austauschen soll. Zusätzlich soll es auch alle Anführungsstriche rauslöschen.
Das Ganze sieht so aus:
PHP:
tell application "Finder"
activate
open document file "test.txt" of folder "Desktop" of folder "userx" of folder "Users" of startup disk
tell application "TextEdit"
set test_str to text of document 1
set AppleScript's text item delimiters to ","
set test_items to text items of test_str
set AppleScript's text item delimiters to ";"
set final_str to test_items as text
set text of document 1 to final_str
end tell
tell application "TextEdit"
set test_str to text of document 1
set AppleScript's text item delimiters to "\""
set test_items to text items of test_str
set AppleScript's text item delimiters to ""
set final_str to test_items as text
set text of document 1 to final_str
end tell
end tell
Relativ easy also.
Aber: Wie realisiert man das autoamtische Abspeichern der Datei "test.txt" via Script und wie schliesst man Textedit wieder?
Danke für Hilfe!