Hi all!
I’m having an issue with a script I’ve set up for my mother to watch for my brother who is in Iraq to show up on iChat during the day, so she knows he’s still alive. The only problem is that I’ve compiled it into an application so she can just leave it running, but she gets an errors that says “File [path removed]:iChatWatcherLog.txt wasn’t found” with the path to my desktop. This even though I’m using the “path to desktop” feature in the actual script. My best guess is that variable is being hard-coded at compile time, so it doesn’t calculate the path to her desktop.
Any suggestions or ideas to fix this issue? Code is as follows:
property was_online : {}
property watch_list : {}
property filePath : (((path to desktop) as string) & "iChatWatcherLog.txt")
set was_online to check_ichat()
set watch_list to {"Name Here"}
on idle
set is_online to check_ichat()
repeat with x in is_online
copy contents of x to y
ignoring case, expansion and white space
if y is not in was_online and y is in watch_list then
set fileRef to open for access filePath with write permission
write (return & y & " came online on " & (current date)) to fileRef starting at eof
close access fileRef
end if
end ignoring
end repeat
set was_online to is_online
return 10
end idle
to check_ichat()
tell application "iChat" to name of accounts of service 1 whose status is not offline
end check_ichat
Thanks!
-Talix
P.S. I’m running OS 10.4, I believe she is on 10.3, though. Possibly even 10.2. It just occurred to me that that may be part of the issue.