I have just recently started learning some Applescript and am moving on now to Xcode.
I have already written an AppleScript which fetches the latest build number of a piece of software from a URL, held in a text file, and uses that to download the latest nightly build of this app. I am now trying to put a UI around it with progress bar. I’ve adapted it for AppleScript Obj-C but can’t seem to get it to work. Can anyone help? Or point me in the right direction?
It doesn’t even seem to get beyond the first curl according to the console logs, it gives the error "couldn’t resolve host ‘value’
on updateChromium_(sender) --obtain latest build number latest's setStringValue_(do shell script" curl http://example/com/latest" as string) build_label's setStringValue_(latest) progress_bar's incrementBy_(10) --set local directory info remFile's setStringValue_("file.zip" as string) locDir's setStringValue_("$HOME" as string) locFile's setStringValue_("file.zip" as string) --download latest build using build number in the_source do shell script "curl [url=http://example.com/]http://example.com/"[/url] & latest & "/" & remFile & " -o " & locDir & locFile build_label's setStringValue_(latest as string) progress_bar's incrementBy_(10) --unpack and copy do shell script "unzip -o " & locDir & locFile & " -d " & locDir progress_bar's incrementBy_(15) --move existing application and copy new try do shell script "cp -pR /Applications/Example.app /Applications/Example.old.app" do shell script "rm -R /Applications/Example.app" end try do shell script "mkdir -p /Applications/Example.app" do shell script "mkdir -p /Applications/Example.app/Contents" do shell script "cp -pR " & locDir & "file/Example.app/Contents /Applications/Example.app" progress_bar's incrementBy_(15) --Cleanup folders and files do shell script "rm -R " & locDir & "file*" progress_bar's incrementBy_(15) try do shell script "rm -R /Applications/Example.old.app" end try end updateChromium_
Model: Xcode 3.2.1 64-bit, Macbook Pro
Browser: Safari 531.21.10
Operating System: Mac OS X (10.6)