AppleScript : Set do script result as variable I would like to get the result of this search and display the result in a notification or safari popup.

" set result to do shell script "curl https://www.binlist.net/json/" &amp; cc without altering line endings" only have as a result the same value of the main query

-- Web site https://www.binlist.net
-- Get https://www.binlist.net/json/431940
set cc to the clipboard
set finalresult to do shell script "curl https://www.binlist.net/json/" &amp; cc without altering line endings
set the clipboard to finalresult

display notification "result is " &amp; finalresult


The result won't display as a notification so for now, its only set as clipboard
Also the result is really raw can I clean that somehow ?

{\"bin\":\"431940\",\"brand\":\"VISA\",\"sub_brand\":\"\",\"country_code\":\"IE\",\"country_name\":\"Ireland\",\"bank\":\"BANK OF IRELAND\",\"card_type\":\"DEBIT\",\"card_category\":\"\",\"latitude\":\"53\",\"longitude\":\"-8\",\"query_time\":\"1.370709ms\"}""


Thanks.
You want the brand and the country_name from the JSON data, you can use a JSON parser.

Here is an example of parsing JSON in python

-- Get https://www.binlist.net/json/431940
set cc to the clipboard as string
set finalresult to do shell script "curl https://www.binlist.net/json/" &amp; cc &amp; "  |  /usr/bin/python -c 'import json, sys; obj=json.load(sys.stdin); print obj[\"brand\"],obj[\"country_name\"]' "
display notification "Result is " &amp; finalresult --&gt; "Result is VISA Ireland"