Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 25.04.2003 - 22:32 Titel: OSAX: Standard Additions - Funktion: read/write |
|
|
Beschreibung: Das Beispielskript legt eine Textdatei an, schreibt in diese Datei und liest die Daten auch wieder aus.
Code:
property x : 0
set derPfad to (path to desktop folder)
set dieDatei to (derPfad as string) & "Neue Datei"
set x to x + 1
tell application "Finder"
if not (exists (file dieDatei)) then
set dieDatei to make new file at derPfad with properties ¬
{ name:"Neue Datei", creator type:"text", file type:"TEXT" }
else
if the creator type of file dieDatei is not equal to ¬
"text" and the file type of file dieDatei is not equal to "TEXT" then
set the creator type of file dieDatei to "text"
set the file type of file dieDatei to "TEXT"
end if
end if
end tell
set dRef to open for access file (dieDatei as string) with write permission
try
set eof dRef to 0
write "Das Skript wurde " & x & " mal ausgeführt." to dRef starting at eof
close access dRef
on error
close access dRef
end try
set theRef to open for access file (dieDatei as string)
try
set myText to (read theRef)
close access theRef
on error errMsg
close access theRef
set myText to errMsg
end try
display dialog myText _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|