Exchange rate display

Hi All,
Is there an exchange rate widget available or is it possible to create one?
Thanks

Hi. I made a script by myself.
it reads http://kur.doviz.com to get gbp usd and eur rates against Turkish lira.
If you need help contact me via emir@emirkaynak.net

script code is attached.
or below

[
{
"BTTWidgetName" : "Exchange Rates",
"BTTTriggerType" : 639,
"BTTTriggerTypeDescription" : "Apple Script Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTEnabled2" : 1,
"BTTUUID" : "46622BF4-D391-4EA7-BD16-E433CBE3DDA2",
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTOrder" : 2,
"BTTDisplayOrder" : 1,
"BTTMergeIntoTouchBarGroups" : 0,
"BTTKeySequence" : {

},
"BTTTriggerConfig" : {
  "BTTTouchBarButtonCornerRadius" : 6,
  "BTTTouchBarFreeSpaceAfterButton" : 0,
  "BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 255.000000",
  "BTTTouchBarApplyCornerRadiusTo" : -1,
  "BTTTouchBarItemPlacement" : 1,
  "BTTTouchBarAppleScriptStringRunOnInit" : true,
  "BTTTouchBarAlwaysShowButton" : false,
  "BTTScriptType" : 0,
  "BTTTouchBarScriptUpdateInterval" : 30,
  "BTTTouchBarButtonWidth" : 100,
  "BTTTouchBarItemIconHeight" : 17,
  "BTTTouchBarButtonTextAlignment" : 0,
  "BTTTouchBarAlternateBackgroundColor" : "0.000000, 0.000000, 0.000000, 255.000000",
  "BTTTouchBarAppleScriptUsePath" : 0,
  "BTTTBWidgetWidth" : 400,
  "BTTTouchBarColorRegex" : "",
  "BTTTouchBarItemIconWidth" : 30,
  "BTTTouchBarButtonName" : "Exchange Rates",
  "BTTTouchBarButtonFontSize" : 11,
  "BTTTouchBarOnlyShowIcon" : false,
  "BTTTouchBarAppleScriptString" : "\r\rset mJson to do shell script \"curl -s 'https:\/\/kur.doviz.com'\"\r\rset AppleScript's text item delimiters to {\"icon-usd\"}\rset keyValueList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair to item 2 of keyValueList\r\r\rset AppleScript's text item delimiters to {\"div class\"}\rset keyValueList to (every text item in theKeyValuePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair to item 1 of keyValueList\r\r\rset AppleScript's text item delimiters to {\"td\"}\rset keyValueList to (every text item in theKeyValuePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair to item 5 of keyValueList\r\rset AppleScript's text item delimiters to {\"<\"}\rset keyValueList to (every text item in theKeyValuePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair to item 1 of keyValueList\r\rset AppleScript's text item delimiters to {\">\"}\rset keyValueList to (every text item in theKeyValuePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair to item 2 of keyValueList\r\r\rset AppleScript's text item delimiters to {\"icon-eur\"}\rset keyValueList1 to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair1 to item 2 of keyValueList1\r\r\rset AppleScript's text item delimiters to {\"div class\"}\rset keyValueList1 to (every text item in theKeyValuePair1) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair1 to item 1 of keyValueList1\r\r\rset AppleScript's text item delimiters to {\"td\"}\rset keyValueList1 to (every text item in theKeyValuePair1) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair1 to item 5 of keyValueList1\r\rset AppleScript's text item delimiters to {\"<\"}\rset keyValueList1 to (every text item in theKeyValuePair1) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair1 to item 1 of keyValueList1\r\rset AppleScript's text item delimiters to {\">\"}\rset keyValueList1 to (every text item in theKeyValuePair1) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair1 to item 2 of keyValueList1\r\r\r\r\rset AppleScript's text item delimiters to {\"icon-gbp\"}\rset keyValueList2 to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair2 to item 2 of keyValueList2\r\r\rset AppleScript's text item delimiters to {\"div class\"}\rset keyValueList2 to (every text item in theKeyValuePair2) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair2 to item 1 of keyValueList2\r\r\rset AppleScript's text item delimiters to {\"td\"}\rset keyValueList2 to (every text item in theKeyValuePair2) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair2 to item 5 of keyValueList2\r\rset AppleScript's text item delimiters to {\"<\"}\rset keyValueList2 to (every text item in theKeyValuePair2) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair2 to item 1 of keyValueList2\r\rset AppleScript's text item delimiters to {\">\"}\rset keyValueList2 to (every text item in theKeyValuePair2) as list\rset AppleScript's text item delimiters to \"\"\r\rset theKeyValuePair2 to item 2 of keyValueList2\r\rset AppleScript's text item delimiters to {\"icon-usd\"}\rset usdArrowList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdArrowPair to item 2 of usdArrowList\r\rset AppleScript's text item delimiters to {\"div class\"}\rset usdArrowList to (every text item in usdArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdArrowPair to item 2 of usdArrowList\r\rset AppleScript's text item delimiters to {\"span class\"}\rset usdArrowList to (every text item in usdArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdArrowPair to item 2 of usdArrowList\r\rset AppleScript's text item delimiters to {\"%\"}\rset usdArrowList to (every text item in usdArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdArrowPair to item 1 of usdArrowList\r\rset AppleScript's text item delimiters to {\"\\\"\"}\rset usdArrowList to (every text item in usdArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdArrowPair to item 2 of usdArrowList\r\rset AppleScript's text item delimiters to {\"arrow \"}\rset usdArrowList to (every text item in usdArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdArrowPair to item 2 of usdArrowList\r\rif usdArrowPair = \"up\" then\r\tset usdarrow to \"β–²\"\relse if usdArrowPair = \"down\" then\r\tset usdarrow to \"β–Ό\"\rend if\r\rset AppleScript's text item delimiters to {\"icon-gbp\"}\rset gbpArrowList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpArrowPair to item 2 of gbpArrowList\r\rset AppleScript's text item delimiters to {\"div class\"}\rset gbpArrowList to (every text item in gbpArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpArrowPair to item 2 of gbpArrowList\r\rset AppleScript's text item delimiters to {\"span class\"}\rset gbpArrowList to (every text item in gbpArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpArrowPair to item 2 of gbpArrowList\r\rset AppleScript's text item delimiters to {\"%\"}\rset gbpArrowList to (every text item in gbpArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpArrowPair to item 1 of gbpArrowList\r\rset AppleScript's text item delimiters to {\"\\\"\"}\rset gbpArrowList to (every text item in gbpArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpArrowPair to item 2 of gbpArrowList\r\rset AppleScript's text item delimiters to {\"arrow \"}\rset gbpArrowList to (every text item in gbpArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpArrowPair to item 2 of gbpArrowList\r\rif gbpArrowPair = \"up\" then\r\tset gbparrow to \"β–²\"\relse if gbpArrowPair = \"down\" then\r\tset gbparrow to \"β–Ό\"\rend if\r\rset AppleScript's text item delimiters to {\"icon-eur\"}\rset eurArrowList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurArrowPair to item 2 of eurArrowList\r\rset AppleScript's text item delimiters to {\"div class\"}\rset eurArrowList to (every text item in eurArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurArrowPair to item 2 of eurArrowList\r\rset AppleScript's text item delimiters to {\"span class\"}\rset eurArrowList to (every text item in eurArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurArrowPair to item 2 of eurArrowList\r\rset AppleScript's text item delimiters to {\"%\"}\rset eurArrowList to (every text item in eurArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurArrowPair to item 1 of eurArrowList\r\rset AppleScript's text item delimiters to {\"\\\"\"}\rset eurArrowList to (every text item in eurArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurArrowPair to item 2 of eurArrowList\r\rset AppleScript's text item delimiters to {\"arrow \"}\rset eurArrowList to (every text item in eurArrowPair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurArrowPair to item 2 of eurArrowList\r\rif eurArrowPair = \"up\" then\r\tset eurarrow to \"β–²\"\relse if eurArrowPair = \"down\" then\r\tset eurarrow to \"β–Ό\"\rend if\r\rset AppleScript's text item delimiters to {\"icon-eur\"}\rset eurvalueList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurvaluePair to item 2 of eurvalueList\r\rset AppleScript's text item delimiters to {\"div class\"}\rset eurvalueList to (every text item in eurvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurvaluePair to item 2 of eurvalueList\r\rset AppleScript's text item delimiters to {\"span class\"}\rset eurvalueList to (every text item in eurvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurvaluePair to item 2 of eurvalueList\r\rset AppleScript's text item delimiters to {\"%\"}\rset eurvalueList to (every text item in eurvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset eurvaluePair to item 2 of eurvalueList\r\rset AppleScript's text item delimiters to {\"<\"}\rset eurvalueList to (every text item in eurvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\r\rset eurvaluePair to item 1 of eurvalueList\r\rset AppleScript's text item delimiters to {\"\"}\rset eurvalueList to (every text item in eurvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\r\rset eurvaluePair1 to item 1 of eurvalueList\rset eurvaluePair2 to item 2 of eurvalueList\rset eurvaluePair3 to item 3 of eurvalueList\rset eurvaluePair4 to item 4 of eurvalueList\r\rset eurvaluePairfull to eurvaluePair1 & eurvaluePair2 & eurvaluePair3 & eurvaluePair4\r\r\rset AppleScript's text item delimiters to {\"icon-gbp\"}\rset gbpvalueList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpvaluePair to item 2 of gbpvalueList\r\rset AppleScript's text item delimiters to {\"div class\"}\rset gbpvalueList to (every text item in gbpvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpvaluePair to item 2 of gbpvalueList\r\rset AppleScript's text item delimiters to {\"span class\"}\rset gbpvalueList to (every text item in gbpvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpvaluePair to item 2 of gbpvalueList\r\rset AppleScript's text item delimiters to {\"%\"}\rset gbpvalueList to (every text item in gbpvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset gbpvaluePair to item 2 of gbpvalueList\r\rset AppleScript's text item delimiters to {\"<\"}\rset gbpvalueList to (every text item in gbpvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\r\rset gbpvaluePair to item 1 of gbpvalueList\r\rset AppleScript's text item delimiters to {\"\"}\rset gbpvalueList to (every text item in gbpvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\r\rset gbpvaluePair1 to item 1 of gbpvalueList\rset gbpvaluePair2 to item 2 of gbpvalueList\rset gbpvaluePair3 to item 3 of gbpvalueList\rset gbpvaluePair4 to item 4 of gbpvalueList\r\rset gbpvaluePairfull to gbpvaluePair1 & gbpvaluePair2 & gbpvaluePair3 & gbpvaluePair4\r\rset AppleScript's text item delimiters to {\"icon-usd\"}\rset usdvalueList to (every text item in mJson) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdvaluePair to item 2 of usdvalueList\r\rset AppleScript's text item delimiters to {\"div class\"}\rset usdvalueList to (every text item in usdvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdvaluePair to item 2 of usdvalueList\r\rset AppleScript's text item delimiters to {\"span class\"}\rset usdvalueList to (every text item in usdvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdvaluePair to item 2 of usdvalueList\r\rset AppleScript's text item delimiters to {\"%\"}\rset usdvalueList to (every text item in usdvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\rset usdvaluePair to item 2 of usdvalueList\r\rset AppleScript's text item delimiters to {\"<\"}\rset usdvalueList to (every text item in usdvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\r\rset usdvaluePair to item 1 of usdvalueList\r\rset AppleScript's text item delimiters to {\"\"}\rset usdvalueList to (every text item in usdvaluePair) as list\rset AppleScript's text item delimiters to \"\"\r\r\rset usdvaluePair1 to item 1 of usdvalueList\rset usdvaluePair2 to item 2 of usdvalueList\rset usdvaluePair3 to item 3 of usdvalueList\rset usdvaluePair4 to item 4 of usdvalueList\r\rset usdvaluePairfull to usdvaluePair1 & usdvaluePair2 & usdvaluePair3 & usdvaluePair4\r\rreturn \"πŸ‡ΊπŸ‡Έ \" & theKeyValuePair & \" - πŸ‡ͺπŸ‡Ί \" & theKeyValuePair1 & \" - πŸ‡¬πŸ‡§ \" & theKeyValuePair2 & \"\n      \" & usdarrow & \"%\" & usdvaluePairfull & \"         \" & eurarrow & \"%\" & eurvaluePairfull & \"        \" & gbparrow & \"%\" & gbpvaluePairfull\r",
  "BTTTouchBarItemPadding" : 0
}

}
]

exchange_rates.bttpreset (224.2 KB).

1 Like
Imprint | Privacy Policy