I have Dropbox file with two lines of data that I'd like to parse into two variables. The following function should have the right logic but doesn't seem to work:
set versionFile to do shell script ("curl -L 'https://www.dropbox.com/s/5eugzgr1alfgsp9/version.txt?dl=1'")
set lineDelimiter to read versionFile using delimiter return
repeat with oneLine in lineDelimiter
if length of oneLine is greater than 0 then
set variable to oneLine
log "variable: " & variable
end if
end repeat
Error:
error "Can’t make \"1.0.0.2
www.example.com/download-link-here\" into type file." number -1700 from "1.0.0.2
www.example.com/download-link-here" to file
Any help is greatly appreciated. Cheers.
versionFile
is a variable that contains the contents of the file not the file itself and you're using theread
command improperly, as it reads data from a file, not a variable.