Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3598130
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:12:14+00:00 2026-05-18T20:12:14+00:00

This is a sample CURL, which is what I am using to try and

  • 0

This is a sample CURL, which is what I am using to try and achieve an automatic upload of a file.

curl http://testflightapp.com/api/builds.json 
  -F file=@testflightapp.ipa 
  -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'

I have made an AppleScript that asks for “notes”, the file and whether to notify:

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

Where I seem to have problems is with the file location. I am not sure, but I think it’s returning the wrong format with : instead of / for the path.

Thanks in advance for any advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:12:15+00:00Added an answer on May 18, 2026 at 8:12 pm

    To get a POSIX path of the form /Users/you/file instead of the classic Mac style path of Macintosh HD:Users:you:file, you can use POSIX path of: set pathToIPA to POSIX path of pathToIPA. However, there are a couple of other things you should fix, in order of importance.

    1. Use quoted form of for any user input which goes to the shell. Otherwise, if the user writes It's good., the shell will see the literal '. Worse, someone could write ; rm -rf ~, and then you’d be hosed.

    2. You don’t need a property for every variable; they’re really for constants.

    3. You’re inconsistent with your naming. It’d be nice to just see these_vars, theseVars, or TheseVars, not all three. A rather minor point, though. A similarly minor point is that you can remove some extra variables, though this is again a style point.

    4. I don’t know which you meant to have, but right after return UploadResponse, you have more code. That code won’t run, because you just returned. Make sure you only leave one of those code paths!

    You need to do #1; the other three things are definitely optional. Even so, this is how I’d rewrite the code:

    property api_token : "SECRET"
    property team_token : "SECRET"
    
    set whats_new to text returned of ¬
        (display dialog "What's new in this version?" default answer "")
    set path_to_IPA to POSIX path of (choose file with prompt "Select IPA")
    set notify_answer to button returned of ¬
        (display dialog "Notify testers?" buttons {"No", "Yes"} default button 2)
    if notify_answer is equal to "No" then
        set notify to "False"
    else if notify_answer is equal to "Yes" then
        set notify to "True"
    else
        error "\"Notify testers\" check failed."
    end if
    
    upload_IPA(api_token, team_token, notify, whats_new, path_to_IPA)
    
    on upload_IPA(api_token, team_token, notify, whats_new, path_to_IPA)
        set test_flight_API_upload_script to "/usr/bin/curl" & ¬
            " http://testflightapp.com/api/builds.json" & ¬
            -- add `@` to refer to the file itself not its path
            " -F " & "file=@" & quoted form of path_to_IPA & ¬ 
            " -F " & "api_token=" & quoted form of api_token & ¬
            " -F " & "team_token=" & quoted form of team_token & ¬
            " -F " & "notes=" & quoted form of whats_new & ¬
            " -F " & "notify=" & quoted form of notify
    
        set upload_response to do shell script test_flight_API_upload_script
        return upload_response
        -- Delete the above line or this if
        if upload_response contains "Status: 200 OK" then
            return "Success!"
        else
            return "Failure!"
        end if
    end upload_IPA
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a sample CURL, which is what I am using to try and
Let's say I want to use this API: http://hiveminder.com/help/reference/API.html The instructions walk through its
I am using curl to get a json file which can be located here:
I have this sample text, which is retrieved from the class name on an
I am trying to get gmail contacts using Google contacts api . For this
Like describe in API Goo.gl Manualy curl work perfectly : curl https://www.googleapis.com/urlshortener/v1/url \ -H
Imagine this sample java class: class A { void addListener(Listener obj); void removeListener(Listener obj);
Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return
Consider this sample class, class TargetClass { private static String SENSITIVE_DATA = sw0rdfish; private
In this sample code the URL of the app seems to be determined by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.