Am I just assuming this should work?
Dawns on me running scripts might not work on "server". it works as a script and as a application. Currently I have it ran as a timed script, but that seems wasteful of system resources. So trying something different, and to better learn what LiveCode can do.
Thanks
~David
Code: Select all
<?rev
put quote & "Finder" & quote into myFinder
put quote & "iChat" & quote into myMessages
put quote & "pipedream01@chat.server.org" & quote into myFriend1
put quote & "pipedream04@chat.server.org" & quote into myFriend2
put quote & "Library:WebServer:Documents:sites:Pipedream:" & quote into myPath
put quote & "iChat.html" & quote into myFile
put quote & "Library:WebServer:Documents:sites:Pipedream:iChat.html" & quote into myFullPath
put "tell application "& myFinder & cr & \
"set startupDisk to startup disk as string " & cr & \
"end tell" & cr & \
"tell application "& myMessages & cr & \
"set iStatus to get status" & cr & \
"set message to get status message "& cr & \
"set isAvailable to (status of buddy " & myFriend1 & ")" & cr & \
"set isMessage to (status message of buddy " & MyFriend1 & ")" & cr & \
"set isImportant to isMessage " & cr & \
"end tell " & cr & \
"set html to isImportant " & cr & \
"if length of html < 8 then " & cr & \
"tell application "& myMessages & cr & \
" set iStatus to get status " & cr& \
" set message to get status message "& cr & \
" set isAvailable to (status of buddy "& myFriend2 &")" & cr & \
" set isMessage to (status message of buddy "& myFriend2 & ")" & cr & \
" set isImportant to isMessage "& cr & \
"end tell " & cr & \
"end if "& cr & \
"if length of html > 8 then " & cr & \
"set parentFolder to startupDisk " & myPath & cr & \
"set fileName to parentFolder " & myFile & ")" & cr & \
"try " & cr & \
"if exists file FullFilePath then " & cr & \
" set the file_to_delete to startupDisk " & myFullPath & cr & \
" delete the file_to_delete " & cr & \
"end if " & cr & \
"if not (the file fileName exists) then " & cr & \
" set theFile to open for access fileName with write permission " & cr & \
" close access theFile "& cr & \
"end if " & cr & \
"on error" & cr & \
" try " & cr & \
" close access thePath " & cr & \
" end try " & cr & \
"end try " & cr & \
"set theFile to open for access fileName with write permission "& cr & \
"set eof of theFile to 0 " & cr & \
"write html to theFile " & cr & \
"close access theFile " & cr & \
"return html " & cr & \
"end if" into tScript
put " Updating URL …"
Put tScript
do tScript as applescript
?>