How to - input data and forwarding it?

Hello everybody!

How do I do this, as simple as possible…

  1. ask the user a number X
  2. fetch some data thru the web by
    set Y to do shell script “/usr/bin/curl

Especially, how do I include this X on this second line?

I hope this is trivail :stuck_out_tongue: Thanks in advance!


try something like…

	set my_number to text returned of (display dialog "Please enter some number..." default answer "123" with title "Request" buttons {"Cancel", "OK"} default button 2 with icon 1)
	if my_number ≠ "" then
			set my_number to my_number as number
			--get the absolute value
			if my_number is less than 0 then
				set my_number to -my_number
			end if
			exit repeat
		end try
	end if
end repeat

do shell script "/usr/bin/curl " & quoted form of ("" & my_number)


Ok, that was good one. Thank.
How should I do this:

I want to

set Y to do shell script "/usr/bin/curl [url=]"[/url]

but if the xxx is in a variable named calc then how should I merge? Like this?

set Y to do shell script "/usr/bin/curl [url=]"[/url] + calc

Or what? I really do not know :rolleyes: all advice are welcome!


+ is an mathematical operator
& is the operator to concatenate text, lists or records

set Y to do shell script "/usr/bin/curl [url=]"[/url] & calc

Thanks again, super!
This way I can now receive and transmit data to remote server. Super!