{"id":1512,"date":"2019-03-26T20:45:00","date_gmt":"2019-03-26T19:45:00","guid":{"rendered":""},"modified":"2020-05-18T20:42:53","modified_gmt":"2020-05-18T18:42:53","slug":"python-script-per-cycle-case-lower","status":"publish","type":"post","link":"https:\/\/digitalia.culturanuova.net\/blog\/?p=1512","title":{"rendered":"python script per cycle case (lower &#8211; mixed &#8211; upper)"},"content":{"rendered":"<p>Utile con autokey. Eccolo:<\/p>\n<p>pre.CICodeFormatter{<br \/>\n font-family:arial;<br \/>\n font-size:12px;<br \/>\n border:1px dashed #CCCCCC;<br \/>\n width:99%;<br \/>\n height:auto;<br \/>\n overflow:auto;<br \/>\n background:#f0f0f0;<br \/>\n line-height:20px;<br \/>\n background-image:URL(http:\/\/2.bp.blogspot.com\/_z5ltvMQPaa8\/SjJXr_U2YBI\/AAAAAAAAAAM\/46OqEP32CJ8\/s320\/codebg.gif);<br \/>\n padding:0px;<br \/>\n color:#000000;<br \/>\n text-align:left;<br \/>\n}<br \/>\npre.CICodeFormatter code{<br \/>\n color:#000000;<br \/>\n word-wrap:normal;<br \/>\n}<\/p>\n<pre class=\"CICodeFormatter\" > # Get the current selection.  \n sText=clipboard.get_selection()  \n lLength=len(sText)  \n   \n try:  \n   if not store.has_key(\"textCycle\"):  \n     store.set_value(\"state\",\"title\")  \n   \n except:  \n   pass  \n   \n # get saved value of textCycle  \n state = store.get_value(\"textCycle\")  \n   \n   \n # modify text and set next modfication style  \n if state == \"title\":  \n   #sText=sText.capitalize()  \n   sText=sText.title()  \n   newstate = \"lower\"  \n   \n elif state == \"lower\":  \n   sText=sText.lower()  \n   newstate = \"upper\"  \n   \n elif state == \"upper\":  \n   sText=sText.upper()  \n   newstate = \"title\"  \n   \n else:  \n   newstate = \"lower\"  \n   \n # save for next run of script  \n store.set_value(\"textCycle\",newstate)    \n   \n # Send the result.  \n keyboard.send_keys(sText)  \n keyboard.send_keys(\"&lt;shift&gt;+&lt;left&gt;\"*lLength)  \n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Utile con autokey. Eccolo: pre.CICodeFormatter{ font-family:arial; font-size:12px; border:1px dashed #CCCCCC; width:99%; height:auto; overflow:auto; background:#f0f0f0; line-height:20px; background-image:URL(http:\/\/2.bp.blogspot.com\/_z5ltvMQPaa8\/SjJXr_U2YBI\/AAAAAAAAAAM\/46OqEP32CJ8\/s320\/codebg.gif); padding:0px; color:#000000; text-align:left; } pre.CICodeFormatter code{ color:#000000; word-wrap:normal; } # Get the current selection. sText=clipboard.get_selection() lLength=len(sText) try: if not store.has_key(&#8220;textCycle&#8221;): store.set_value(&#8220;state&#8221;,&#8221;title&#8221;) except: pass # get saved value of textCycle state = store.get_value(&#8220;textCycle&#8221;) # modify text and set next modfication &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/digitalia.culturanuova.net\/blog\/?p=1512\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;python script per cycle case (lower &#8211; mixed &#8211; upper)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[578],"tags":[127,196,197,198,199,200,201],"class_list":["post-1512","post","type-post","status-publish","format-standard","hentry","category-tools","tag-autokey","tag-capitaluize","tag-cycle-case","tag-lowercase","tag-mixed-case","tag-python","tag-uppercase"],"_links":{"self":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1512"}],"version-history":[{"count":2,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1512\/revisions"}],"predecessor-version":[{"id":2015,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1512\/revisions\/2015"}],"wp:attachment":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}