# Snippets

Name: Keyboard help
BeforeSelection:
[shift] [ctrl] [alt] [win] [cmd] [enter]
[space] [tab] [esc] [backspace] [delete] [clear]
[up] [down] [left] [right] [pageup] [pagedown]
[home] [end] [insert] [f1] .. [f15]
[printscreen] [scrolllock] [pause] [capslock] [numlock]


Name: Excel Read
BeforeSelection: data_array =
AfterSelection:
[excel.xlsx]sheet!A1:J100
//-- top_profit = [Monthly Report.xlsx]August!E10
//-- top_salesman = [Monthly Report.xlsx]August!E11
//-- data_array = [Quarterly Metrics.xlsx]Main!B3:G100


Name: Excel Echo (For Loops)
BeforeSelection:
for row from 0 to data_array.length-1
  for col from 0 to data_array[row].length-1
    echo `data_array[row][col]`


Name: Excel Write
BeforeSelection: [excel.xlsx]sheet!A1 =
AfterSelection:
variable
//-- [Monthly Report.xlsx]August!E10 = 12345
//-- [Monthly Report.xlsx]August!E11 = "Alan"
//-- [Monthly Report.xlsx]August!E12 = variable
//-- [Quarterly Metrics.xlsx]Main!B3 = data_array


Name: API
BeforeSelection: api
AfterSelection:
https://api.github.com/repos/kelaberetiv/TagUI/releases
//-- echo `api_result`
//-- author = api_json[0].author.login


Name: API using JS
BeforeSelection:
//-- API using JS
param2 = 'param2'
js xhr_post_api = new XMLHttpRequest();
js url_post_api = "https://api.test.com/test";
js param3 = "param3";
js data_post_api = '{"param1":"param1", "param2":"`param2`", "param3":"`param3`"}'
js begin
xhr_post_api.open("POST", url_post_api, false);
xhr_post_api.setRequestHeader("Content-Type", "application/json");
xhr_post_api.onreadystatechange = function(){
  if(xhr_post_api.readyState === 4){}
};
xhr_post_api.send(data_post_api);
js finish


Name: Ask or Prompt
BeforeSelection: ask
AfterSelection:
[prompt]
//-- ask What is the date of the receipt? (in DD-MM-YYYY)
//-- type search as `ask_result`



