I’m trying to write a script that connects to the internet and saves a log that keeps track of the time I stay conected to the internet (via telephone) but I keep getting an error I don’t now how to fix. The most amusing part is that the file is saved with the correct data I asked for, but returns an error anyway.
Here are some of the things I tried with no success:
archivo would be the name of the file (defined somewhere else)
carpeta would be the folder
Tell app “TextEdit”
.
.
.
make new document at the beginning of documents with properties {name:“” & archivo}
set the name of window 1 to archivo
set zoomed of the front window to false
set visible of the front window to true – false false when it all works
set the text of the front document to Datos as string
save the front document in (archivo) – this one actually saves it, but returns error
– set the carpeta to path to desktop folder as alias
– close front document saving in file {archivo} as alias saving ask
– in the folder “Desktop” of the folder “nico” of the folder “Users” of the disk “Mac HD”
– in file (“Mac HD:Users:nico:Desktop:” & archivo)
– the error is here, but I don’t understand what happens
--«event ascrgdut» This is the returned error!!
.
.
.
end tell
It would be nice if I could save the log always in the same file (and just add text to it)