這是一個CURL示例,這是我用來嘗試實現文件自動上傳的示例。AppleScript cURL文件上傳幫助
curl http://testflightapp.com/api/builds.json
-F [email protected]
-F api_token='your_api_token'
-F team_token='your_team_token'
-F notes='This build was uploaded via the upload API'
-F notify=True
-F distribution_lists='Internal, QA'
我已經提出,要求提供「票據」,該文件一個AppleScript和是否通知:
property api_token : "SECRET"
property team_token : "SECRET"
property notify : "False"
property pathToIPA : ""
property whats_new : ""
set whats_new_prompt to (display dialog "What's new in this version?" default answer "")
set whats_new to text returned of whats_new_prompt
set pathToIPA to (choose file with prompt "Select IPA")
set pathToIPA to (pathToIPA as text)
set notify_question to display dialog "Notify testers?" buttons {"No", "Yes"} default button 2
set notify_answer to button returned of notify_question
if notify_answer is equal to "No" then
set notify to "False"
end if
if notify_answer is equal to "Yes" then
set notify to "True"
end if
uploadIPA(api_token, team_token, notify, whats_new, pathToIPA)
on uploadIPA(api_token, team_token, notify, whats_new, pathToIPA)
set TestFlightAPIUploadScript to "/usr/bin/curl" & ¬
" http://testflightapp.com/api/builds.json " & ¬
" –F " & "file=" & pathToIPA & ¬
" –F " & "api_token=" & api_token & ¬
" –F " & "team_token=" & team_token & ¬
" –F " & "notes=" & whats_new & ¬
" –F " & "notify=" & notify
set UploadResponse to do shell script TestFlightAPIUploadScript
return UploadResponse
if UploadResponse contains "Status: 200 OK" then
return "Success!"
else
return "Failure!"
end if
end uploadIPA
在哪裏我似乎有問題,是與該文件的位置。我不確定,但我認爲它的格式爲:而不是/路徑。
在此先感謝您的任何建議。
感謝您的所有信息和修訂腳本。它似乎最初工作,但沒有上傳。我最終看到的結果是整個腳本,現在看起來是正確的。這次我沒有被退回任何錯誤。它是否過早停止?再次感謝你的幫助。 – runmad 2010-12-05 18:52:24