Reading a version file from a website then downloading a newer version of an app
Reading a version file from a website then downloading a newer version of an app
- Subject: Reading a version file from a website then downloading a newer version of an app
- From: Daniel Chavez <email@hidden>
- Date: Mon, 25 Sep 2017 14:09:15 -0600
Hello,
I am trying to figure out this issue.
I have a file that has a version number, as well as a download link for a new
version of an app I am working on.
Both the version number and download link reside in the version file, called
version.txt on my web server. I am trying to get curl to read the contents of
the file, then if the new version exists (according to the version file,) the
user will be told that a new version of the app is being downloaded.
This is what I have to work with, this is for AppleScript and curl:
set lineDelimiter to paragraphs of versionFile
set versionFile to do shell script ("curl -L
'https://chavezapps.us/NetUtilsSierraData/version.txt'")
set lineDelimiter to paragraphs of versionFile
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
tell current application
do shell script "curl -L 'https://www.example.com/appdata/version.txt'
--> "2.0.1
www.example.com/downloads/app <http://www.example.com/downloads/app>.dmg"
(*variable: 2.0.1*)
(*variable: www.example.com/downloads/app.dmg*)
end tell
If any of this needs corrections, please let me know.
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden