Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
macjoe •->

Anmeldedatum: 07.05.2003 Beiträge: 14
|
Verfasst am: 08.06.2003 - 10:56 Titel: Logfile erzeugen |
|
|
Hallo,
kann ich eigentlich mit AppleScript direkt ein Logfile erzeugen ohne ein Hilfsprogramm wie SimpleText o.ä. zu verwenden?
Danke für euere Hilfe.
Viele Grüsse
Macjoe |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 08.06.2003 - 12:19 Titel: Re: Logfile erzeugen |
|
|
macjoe hat Folgendes geschrieben: | kann ich eigentlich mit AppleScript direkt ein Logfile erzeugen ohne ein Hilfsprogramm wie SimpleText o.ä. zu verwenden? |
Na klar! Mit 'read' und 'write' kommst du schon sehr weit. Die Grundlagen dazu findes du in den beiden Workshop-Aritkeln zum 'write'-Befehl.
Gruß _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 08.06.2003 - 18:00 Titel: |
|
|
Ich habe gerade mal die Skripts aus dem Kontextmenü des Skripteditor 2.0 angesehen. Da ist ein komplett vorgefertigter Skriptteil, um ein Fehler-Log zu erstellen:
Code:
try
on error the error_message number the error_number
set the error_text to "Error: " & the error_number & ". " & the error_message
-- the following line evokes the sub-routine to write the error into an error log created on the desktop
-- if the file "Script Error Log.txt" already exists, it will add one line to the log
my write_error_log(the error_text)
end try
on write_error_log(this_error)
set the error_log to ((path to desktop) as text) & "Script Error Log.txt"
try
open for access file the error_log with write permission
write (this_error & return) to file the error_log starting at eof
close access file the error_log
on error
try
close access file the error_log
end try
end try
end write_error_log _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|
Nach oben |
|
 |
|