<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Работа с гугл-таблицами]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=12254</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12254&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Работа с гугл-таблицами».]]></description>
		<lastBuildDate>Wed, 18 Dec 2019 08:34:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136922#p136922</link>
			<description><![CDATA[<p>Собственно, вот: создал новенькую таблицу. Это код на АХК:<br /></p><div class="codebox"><pre><code>

msgbox, % RegExMatch(httprequest(&quot;https://script.google.com/macros/s/AKfycbxREFHUJxV-et-c0CKpLO1bWx2LHY_eCUvhWDCzSfs0aNXbkNE/exec&quot;), &quot;Hello, world&quot;)

HttpRequest(HttpRequestUrl, delay := 15) { ; выполняет HTTP запрос
    ComObjError(false)
	whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
	whr.Open(&quot;GET&quot;, HttpRequestUrl, true)
	whr.Send()
	whr.WaitForResponse(delay)
    rt := whr.ResponseText
    IniWrite, %rt%, %Dir%\Cache\HTTPRequest\History.ini, %A_DD%.%A_MM%.%A_YYYY% %A_Hour%:%A_Min%:%A_Sec%, RequestText
	return, % whr.ResponseText
}</code></pre></div><p>Код в таблице:<br /></p><div class="codebox"><pre><code>function doGet(e) {
  return HtmlService.createHtmlOutput(&quot;Hello, world&quot;);
}
</code></pre></div><p>Опубликовал через: Опубликовать --&gt; как веб-приложение --&gt; от чьего имени выполнять приложение: от моего --&gt; кто может использовать приложение: все, включая анонимных пользователей. После чего даешь приложению доступ к управлению от твоего имени и получаешь ссылку: <a href="https://prnt.sc/qcffkj">скрин.</a></p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Wed, 18 Dec 2019 08:34:22 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136922#p136922</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136909#p136909</link>
			<description><![CDATA[<p>Кто его знает, может вы какую-то секретную технику используете.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 16 Dec 2019 19:28:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136909#p136909</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136905#p136905</link>
			<description><![CDATA[<p>Подождите ка через API? У меня до сих пор работает авторизация скриптов через анонимные запросы (правда на lua, АХК давненько не использовал). Или это только потому что приложение было создано давно?</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Mon, 16 Dec 2019 18:15:38 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136905#p136905</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136857#p136857</link>
			<description><![CDATA[<p>Может отсюда информация пригодится:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=14569">http://forum.script-coding.com/viewtopic.php?id=14569</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 14 Dec 2019 23:46:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136857#p136857</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136847#p136847</link>
			<description><![CDATA[<p>Для себя когда-то писал. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Может, сейчас там изменилось что-то.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 14 Dec 2019 00:23:46 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136847#p136847</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136846#p136846</link>
			<description><![CDATA[<p>Спасибо за оперативный ответ в три часа ночи. Ушел разбираться <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Zmey25)]]></author>
			<pubDate>Sat, 14 Dec 2019 00:20:29 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136846#p136846</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136845#p136845</link>
			<description><![CDATA[<p>Для чтения таблиц нужно получить ключ:</p><p>1) Авторизоваться в Google<br />2) Зайти на <a href="https://console.developers.google.com/">https://console.developers.google.com/</a><br />3) Создать новый проект<br />4) Перейти в библиотеку API<br />5) Найти Google Sheets API, включить<br />6) Перейти на вкладку Учетные данные (слева)<br />7) Кнопка Создать учетные данные —&gt; Ключ API<br />8) Скопировать, закрыть (Применять ограничения ключа не нужно)<br />Этот ключ будет использоваться для чтения таблицы в скрипте.</p><p>Google Sheets API:<br />⚪ Зайти на <a href="https://developers.google.com/sheets/api/reference/rest?apix=true">https://developers.google.com/sheets/ap … ?apix=true</a><br />⚪ Кликнуть по нужному методу, откроется редактор<br />⚪ Ввести нужные данные, запустить<br />⚪ Скопировать сформированный URL, который потом можно использовать в скрипте</p><p>Справка по чтению данных из таблицы:<br /><a href="https://developers.google.com/sheets/api/samples/reading">https://developers.google.com/sheets/ap … es/reading</a></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 14 Dec 2019 00:11:39 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136845#p136845</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=136843#p136843</link>
			<description><![CDATA[<p>Добрый день.</p><p>Со времен последнего ответа по теме, видимо, гугл прикрыли возможность приложениям без авторизации отправлять гет запросы на app script.</p><p>Подскажите, может кто-то знает еще методы отправить данные на гугл таблицы без авторизации.</p><p>Или подскажите как приложению на ахк правильно авторизоваться, чтобы его запрос принял google app script.</p><p>Заранее благодарен.</p>]]></description>
			<author><![CDATA[null@example.com (Zmey25)]]></author>
			<pubDate>Sat, 14 Dec 2019 00:03:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=136843#p136843</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117412#p117412</link>
			<description><![CDATA[<p><strong>Bamboocho</strong>, это уже не распространяется на этот форум. Нужно изучать google apps script как отдельный язык. Вот тут помощь: <a href="https://plus.google.com/communities/110878650918085680190">https://plus.google.com/communities/110 … 8085680190</a>. А вот тут классы и функции: <a href="https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet">https://developers.google.com/apps-scri … preadsheet</a>. Есть функция выбора листа по имени, цвету, номеру, но я давно использовал её, не помню уже, ищите.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Thu, 20 Jul 2017 16:04:50 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117412#p117412</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117410#p117410</link>
			<description><![CDATA[<p><strong>belyankin12,</strong> сделал все, как вы написали (макрос), но остался вопрос: как сделать так, чтобы скрипт заносил информацию не в первый лист, а в следующий и, желательно, с возможностью выбора листа?</p>]]></description>
			<author><![CDATA[null@example.com (Bamboocho)]]></author>
			<pubDate>Thu, 20 Jul 2017 15:15:51 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117410#p117410</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=110404#p110404</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>будет работать на ahk 32bit</p></blockquote></div><p>Зачем, есть же универсальный вариант:<br /></p><div class="codebox"><pre><code>URIEncode(str, encoding := &quot;UTF-8&quot;)
{
   PrevFormat := A_FormatInteger
   SetFormat, IntegerFast, H

   VarSetCapacity(var, StrPut(str, encoding))
   StrPut(str, &amp;var, encoding)

   While code := NumGet(Var, A_Index - 1, &quot;UChar&quot;)
   {
      bool := (code &gt; 0x7F || code &lt; 0x30 || code = 0x3D)
      UrlStr .= bool ? &quot;%&quot; . SubStr(&quot;0&quot; . SubStr(code, 3), -1) : Chr(code)
   }
   SetFormat, IntegerFast, % PrevFormat
   Return UrlStr
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 29 Dec 2016 14:05:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=110404#p110404</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=110403#p110403</link>
			<description><![CDATA[<p>Кодируйте передаваемые параметры (будет работать на ahk 32bit):<br /></p><div class="codebox"><pre><code>UriEncode(Uri)
{
    oSC := ComObjCreate(&quot;ScriptControl&quot;)
    oSC.Language := &quot;JScript&quot;
    Script := &quot;var Encoded = encodeURIComponent(&quot;&quot;&quot; . Uri . &quot;&quot;&quot;)&quot;
    oSC.ExecuteStatement(Script)
    Return, oSC.Eval(&quot;Encoded&quot;)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 29 Dec 2016 12:37:11 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=110403#p110403</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=110401#p110401</link>
			<description><![CDATA[<p>Через браузер нет.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Thu, 29 Dec 2016 11:41:59 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=110401#p110401</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=110399#p110399</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>если напрямую кидать русский текст в параметры выходят иероглифы</p></blockquote></div><p>Через браузер тоже?</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 29 Dec 2016 11:27:47 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=110399#p110399</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с гугл-таблицами]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=110397#p110397</link>
			<description><![CDATA[<p>Пользователь, что мне отправил сообщение в ЛС (я узнал о нем благодаря почтовому роботу), я не знаю как отправлять сообщения в ЛС, потому скину все это сюда)). </p><p>Код веб-приложения-макросса:</p><div class="codebox"><pre><code>
function doGet(e)
{
  var sheet = SpreadsheetApp.openById(&quot;ссылка гугл таблицы&quot;);
  var d = new Date(), params = e.parameter;
  sheet.appendRow( [&quot;&quot;, &quot;&quot;, params[&quot;nick&quot;], transliterate(params[&quot;reason&quot;], true), params[&quot;source&quot;]] ); // добавить новую строку ( [&quot;¤чейка1&quot;, &quot;¤чейка2&quot;, &quot;¤чейка3&quot;, ...] )
}

transliterate = (
	function() {
		var
			rus = &quot;щ ш ч ц ю ¤ Є ж ъ ы э а б в г д е з и й к л м н о п р с т у ф х ь&quot;.split(/ +/g),
			eng = &quot;[[shh]] [[sh]] [[ch]] [[cz]] [[yu]] [[ya]] [[yo]] [[zh]] [[``]] [[y&#039;]] [[e`]] [[a]] [[b]] [[v]] [[g]] [[d]] [[e]] [[z]] [[i]] [[j]] [[k]] [[l]] [[m]] [[n]] [[o]] [[p]] [[r]] [[s]] [[t]] [[u]] [[f]] [[x]] [[`]]&quot;.split(/ +/g)
		
		return function(text, engToRus) {
			var x;
			for(x = 0; x &lt; rus.length; x++) {
				text = text.split(engToRus ? eng[x] : rus[x]).join(engToRus ? rus[x] : eng[x]);
				text = text.split(engToRus ? eng[x].toUpperCase() : rus[x].toUpperCase()).join(engToRus ? rus[x].toUpperCase() : eng[x].toUpperCase());	
			}
			return text;
		}
	}
)();</code></pre></div><p>Основной код это первые четыре строчки, дальше идёт преобразование с транслита в русский текст (если напрямую кидать русский текст в параметры выходят иероглифы).</p><p>Код AHK:<br /></p><div class="codebox"><pre><code>
url := &quot;ссылка на веб-приложение/exec?nick=&quot; var &quot;&amp;source=&quot;var &quot;&amp;reason=&quot; translit(var)
		whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
		whr.Open(&quot;GET&quot;, url, true)
		whr.Send()
</code></pre></div><p>Код преобразования в транслит:<br /></p><div class="codebox"><pre><code>
translit(repstr)
{
	StringReplace, repstr, repstr, а , [[a]] , All
	StringReplace, repstr, repstr, б , [[b]] , All
	StringReplace, repstr, repstr, в , [[v]] , All
	StringReplace, repstr, repstr, г , [[g]] , All
	StringReplace, repstr, repstr, д , [[d]] , All
	StringReplace, repstr, repstr, е , [[e]] , All
	StringReplace, repstr, repstr, ё , [[yo]] , All
	StringReplace, repstr, repstr, ж , [[zh]] , All
	StringReplace, repstr, repstr, з , [[z]] , All
	StringReplace, repstr, repstr, и , [[i]] , All
	StringReplace, repstr, repstr, й , [[j]] , All
	StringReplace, repstr, repstr, к , [[k]] , All
	StringReplace, repstr, repstr, л , [[l]] , All
	StringReplace, repstr, repstr, м , [[m]] , All
	StringReplace, repstr, repstr, н , [[n]] , All
	StringReplace, repstr, repstr, о , [[o]] , All
	StringReplace, repstr, repstr, п , [[p]] , All
	StringReplace, repstr, repstr, р , [[r]] , All
	StringReplace, repstr, repstr, с , [[s]] , All
	StringReplace, repstr, repstr, т , [[t]] , All
	StringReplace, repstr, repstr, у , [[u]] , All
	StringReplace, repstr, repstr, ф , [[f]] , All
	StringReplace, repstr, repstr, х , [[x]] , All
	StringReplace, repstr, repstr, ц , [[cz]] , All
	StringReplace, repstr, repstr, ч , [[ch]] , All
	StringReplace, repstr, repstr, ш , [[sh]] , All
	StringReplace, repstr, repstr, щ , [[shh]] , All
	StringReplace, repstr, repstr, ъ , [[````]] , All
	StringReplace, repstr, repstr, ы , [[y&#039;]] , All
	StringReplace, repstr, repstr, ь , [[``]] , All
	StringReplace, repstr, repstr, э , [[e``]] , All
	StringReplace, repstr, repstr, ю , [[yu]] , All
	StringReplace, repstr, repstr, я , [[ya]] , All

	StringReplace, repstr, repstr, А , [[A]] , All
	StringReplace, repstr, repstr, Б , [[b]] , All
	StringReplace, repstr, repstr, В , [[V]] , All
	StringReplace, repstr, repstr, Г , [[G]] , All
	StringReplace, repstr, repstr, Д , [[D]] , All
	StringReplace, repstr, repstr, Е , [[E]] , All
	StringReplace, repstr, repstr, Ё , [[YO]] , All
	StringReplace, repstr, repstr, Ж , [[ZH]] , All
	StringReplace, repstr, repstr, З , [[Z]] , All
	StringReplace, repstr, repstr, И , [[i]] , All
	StringReplace, repstr, repstr, Й , [[J]] , All
	StringReplace, repstr, repstr, К , [[K]] , All
	StringReplace, repstr, repstr, Л , [[L]] , All
	StringReplace, repstr, repstr, М , [[M]] , All
	StringReplace, repstr, repstr, Н , [[N]] , All
	StringReplace, repstr, repstr, О , [[O]] , All
	StringReplace, repstr, repstr, П , [[P]] , All
	StringReplace, repstr, repstr, Р , [[R]] , All
	StringReplace, repstr, repstr, С , [[S]] , All
	StringReplace, repstr, repstr, Т , [[T]] , All
	StringReplace, repstr, repstr, У , [[u]] , All
	StringReplace, repstr, repstr, Ф , [[F]] , All
	StringReplace, repstr, repstr, Х , [[X]] , All
	StringReplace, repstr, repstr, Ц , [[CZ]] , All
	StringReplace, repstr, repstr, Ч , [[CH]] , All
	StringReplace, repstr, repstr, Ш , [[SH]] , All
	StringReplace, repstr, repstr, Щ , [[SHH]] , All
	StringReplace, repstr, repstr, Ъ , [[````]] , All
	StringReplace, repstr, repstr, Ы , [[Y&#039;]] , All
	StringReplace, repstr, repstr, Ь , [[``]] , All
	StringReplace, repstr, repstr, Э , [[E``]] , All
	StringReplace, repstr, repstr, Ю , [[YU]] , All
	StringReplace, repstr, repstr, Я , [[YA]] , All
	
	return repstr
}</code></pre></div><p>Параметры (var) выведите сами уже.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Thu, 29 Dec 2016 10:24:20 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=110397#p110397</guid>
		</item>
	</channel>
</rss>
