Open file in default folder and read automatically (short description)

Adrian Williams adrian at clubtype.co.uk
Tue Apr 22 11:53:43 EDT 2008


Hello List,
Working on a script to 'check for updates' of a rev stand alone (not  
the Rev program itself or its engine).

Short explanation:
Read plain text from a file automatically from the default Folder (NOT  
using the answer file: routine).
Then perform if/then tasks on the retrieved value.

Longer explanation:
Download a plain text file with a program's latest version number  
"303" and check against that which is in the standalone.
If the number is lower in the stand alone, offer an update to user.
 From the stack I have a method of manually asking for the downloaded  
file "vers.txt",
but I don't want the user to go seaching for the file --its in the  
default Folder.
There MUST me a way to seamlessly import contents of this (plain text)  
file, but all the documented methods don't work for me.
I've tried countless ways, but no joy. So what am I missing?
Script so far (which gets file contents manually) is below:

-- start --------------------------------
on mouseUp
libURLDownloadToFile "http://www.clubtype.co.uk/vers.txt",vers.txt
global gFilePath
answer file "select a file"
if it contains ".txt" then
put URL ("file:" & it) into AddListContents
put it into gFilePath
put AddListContents into field "F2" --so I can see and check the value
-- then do number comparisons
end mouseUp

Thanks,
Adrian
______________________
Club Type
http://www.clubtype.co.uk
<adrian at clubtype.co.uk>






More information about the use-livecode mailing list