{"id":55090,"date":"2022-03-07T03:01:44","date_gmt":"2022-03-06T17:01:44","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=55090"},"modified":"2022-03-07T12:15:26","modified_gmt":"2022-03-07T02:15:26","slug":"apple-script-macos-desktop-application-scheduled-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-macos-desktop-application-scheduled-tutorial\/","title":{"rendered":"Apple Script macOS Desktop Application Scheduled Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/open_last_five_emails_scheduled.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Apple Script macOS Desktop Application Scheduled Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/open_last_five_emails_scheduled.jpg\" title=\"Apple Script macOS Desktop Application Scheduled Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Apple Script macOS Desktop Application Scheduled Tutorial<\/p><\/div>\n<p>The focus of yesterday&#8217;s <a title='Apple Script macOS Desktop Application Primer Tutorial' href='#asosdapt'>Apple Script macOS Desktop Application Primer Tutorial<\/a> was on &#8230;<\/p>\n<p><code><br \/>\nan interactive macOS desktop application mode of use<br \/>\n<\/code><\/p>\n<p> &#8230; but there are many reasons you might prefer a &#8220;scheduled&#8221; rather than &#8220;interactive&#8221; mode of use.  We can think, off the top of our heads, of &#8230;<\/p>\n<ul>\n<li>&#8220;the user&#8221; &#8230; cannot be there interactively<\/li>\n<li>does not need to be there<\/li>\n<li>does not want to be there<\/li>\n<li>is tied up with another task<\/li>\n<li>&#8220;the task&#8221; &#8230; is of lower priority<\/li>\n<li>is optional<\/li>\n<li>is purely informational<\/li>\n<li>exact timing is important<\/li>\n<li>is part of another task&#8217;s workflow<\/li>\n<\/ul>\n<p> &#8230; reasons you might be keen on a &#8220;scheduled&#8221; (or &#8220;batch&#8221; mode) use of your desktop application, ours being an <a target=_blank title='AppleScript information from Apple' href='https:\/\/developer.apple.com\/library\/archive\/documentation\/AppleScript\/Conceptual\/AppleScriptLangGuide\/introduction\/ASLR_intro.html'>Apple Script<\/a> produced macOS one (with a .app file extension).<\/p>\n<p>We&#8217;re keen, down the track, to integrate <i>a standalone &#8220;scheduled&#8221; mode of use<\/i> of <font color=blue>our amended <a target=_blank title='Useful link, thanks' href='https:\/\/apple.stackexchange.com\/questions\/343710\/applescript-count-length'>, thanks<\/a><\/font> &#8230;<\/p>\n<p><code><br \/>\ntell application \"Mail\"<br \/>\n<br \/>\t<br \/>\n\tset myMessages to messages 1 through 5 of inbox whose read status = false<br \/>\n<br \/>\t<br \/>\n\trepeat with aMesseage in myMessages<br \/>\n\t\tset this_subject to subject of aMesseage<br \/>\n\t\tset this_body to content of aMesseage<br \/>\n\t\t<font color=blue>if this_body contains \"Big Number Game request\" then<br \/>\n\t\t\topen (contents of aMesseage)<br \/>\n\t\tend if<br \/>\n\t\tset alen to (get length of (this_subject as rich text))<br \/>\n\t\tif this_subject contains \"Re: \" then<br \/>\n\t\t\tif alen = 1 then<br \/>\n\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\tend if<br \/>\n\t\t\tif alen = 5 then<br \/>\n\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\tend if<br \/>\n\t\t\tif alen = 6 then<br \/>\n\t\t\t\tif this_subject contains \"0 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"1 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"2 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"3 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"4 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"5 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"6 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"7 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"8 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\t\tif this_subject contains \"9 \" then<br \/>\n\t\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\t\tend if<br \/>\n\t\t\tend if<br \/>\n\t\tend if<\/font><br \/>\n\t\tif this_subject contains \" \" then<br \/>\n\t\t\tthis_subject = this_subject<br \/>\n\t\telse<br \/>\n\t\t\tif this_body contains \" \" then<br \/>\n\t\t\t\tthis_body = this_body<br \/>\n\t\t\telse<br \/>\n\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\tend if<br \/>\n\t\tend if<br \/>\n<br \/>\t<br \/>\n\tend repeat<br \/>\n<br \/>\t<br \/>\nend tell<br \/>\n<\/code><\/p>\n<p> &#8230; macOS &#8230;<\/p>\n<p><code><br \/>\n~\/Desktop\/OpenLastFiveEmails.app<br \/>\n<\/code><\/p>\n<p> &#8230; desktop application be &#8220;scheduled&#8221; via <a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'>cron<font size=1>tab<\/font><\/a> arrangement &#8230;<\/p>\n<p><code><br \/>\n* * * * * open ~\/Desktop\/OpenLastFiveEmails.app<br \/>\n<\/code><\/p>\n<p> &#8230; and the arrangement works a treat being <i>a standalone &#8220;scheduled&#8221; mode of use<\/i> kicking into play without user intervention every minute, and not opening emails we did not want it to open, but did open the emails we intended to programmatically open for the user of the macOS laptop.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-macos-desktop-application-scheduled-tutorial'>Apple Script macOS Desktop Application Scheduled Tutorial<\/a>.<\/p-->\n<hr>\n<p id='asosdapt'>Previous relevant <a target=_blank title='Apple Script macOS Desktop Application Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-macos-desktop-application-primer-tutorial\/'>Apple Script macOS Desktop Application Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/open_last_five_emails.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Apple Script macOS Desktop Application Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/open_last_five_emails.jpg\" title=\"Apple Script macOS Desktop Application Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Apple Script macOS Desktop Application Primer Tutorial<\/p><\/div>\n<p>Server computers around the world are serving you.  Some programmers used to restrict their orbit to the desktop application world of non-mobile platforms.  And just because a lot of the online world has diminished the attention here, and security issues have restricted the &#8220;possibility thinking&#8221; away from desktop applications, doesn&#8217;t mean they are not still there.<\/p>\n<p>Take &#8220;macOS&#8221;.<\/p>\n<blockquote style=font-size:10px;><p>To the beach would be nice, but if you can&#8217;t do that, well, please use your imagination here.<\/p><\/blockquote>\n<p>It has a scripting environment called <a target=_blank title='AppleScript information from Apple' href='https:\/\/developer.apple.com\/library\/archive\/documentation\/AppleScript\/Conceptual\/AppleScriptLangGuide\/introduction\/ASLR_intro.html'>Apple Script<\/a> we took an interest in with <a title='Apple Script Execution of Start Word Suggestions for Wordle Tutorial' href='#aseswswt'>Apple Script Execution of Start Word Suggestions for Wordle Tutorial<\/a>.  Now, if <a target=_blank title=Apple href='http:\/\/apple.com'>Apple<\/a>&#8216;s macOS has this AppleScript &#8220;out of the box&#8221; then this is the &#8220;not hitting your head against a brick wall&#8221; approach to achieving a &#8220;macOS desktop application&#8221; solution to a task you want to achieve on macOS.<\/p>\n<p>We have one, and when you see it, you&#8217;ll probably guess at what we are aiming at.  But, today, we just want to show you that the end result of your AppleScript coding (via its File -&gt; Save menu) can fall into one of &#8230;<\/p>\n<ul>\n<li>Script<\/li>\n<li>Script bundle<\/li>\n<li>Application<\/li>\n<li>Text<\/li>\n<\/ul>\n<p> &#8230; output options, and it is that &#8220;Application&#8221; output of interest to us, and hopefully, to you, today.<\/p>\n<p>And so, if we offer you up (after great advice from <a target=_blank href='https:\/\/stackoverflow.com\/questions\/17183033\/trying-to-get-the-contents-of-an-email-message-in-applescript-without-added-char' title='Useful link, thanks'>this useful link<\/a>) the following AppleScript script &#8230;<\/p>\n<p><code><br \/>\ntell application \"Mail\"<br \/>\n\tset myMessages to messages 1 through 5 of inbox whose read status = false<br \/>\n\trepeat with aMesseage in myMessages<br \/>\n\t\tset this_subject to subject of aMesseage<br \/>\n\t\tset this_body to content of aMesseage<br \/>\n\t\tif this_subject contains \" \" then<br \/>\n\t\t\tthis_subject = this_subject<br \/>\n\t\telse<br \/>\n\t\t\tif this_body contains \" \" then<br \/>\n\t\t\t\tthis_body = this_body<br \/>\n\t\t\telse<br \/>\n\t\t\t\topen (contents of aMesseage)<br \/>\n\t\t\tend if<br \/>\n\t\tend if<br \/>\n\tend repeat<br \/>\nend tell<br \/>\n<\/code><\/p>\n<p> &#8230; it&#8217;s pretty self explanatory that it (is a macOS desktop application that) &#8230;<\/p>\n<ol>\n<li>in macOS environment opens Mail desktop application &#8230;<\/li>\n<li>selects first 5 unread email messages &#8230;<\/li>\n<li>tests each for a Subject and Body contents not containing a space character, and only if so &#8230;<\/li>\n<li>open that email message &#8230; effectively causing that email to be read<\/li>\n<\/ol>\n<p>Not that much code for quite a bit of work, in our books <font size=1>(and the pamphlettes are nodding sagely)<\/font>.<\/p>\n<p>Had we saved as a &#8220;Script&#8221; file on the Desktop folder, on executing it via a double click you&#8217;d have been asked to also click a &#8220;Play&#8221; button.  Along the way you may be asked, once, to clear such a desktop application to allow access to the Mail application, for Apple security purposes.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-macos-desktop-application-primer-tutorial\/'>Apple Script macOS Desktop Application Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='aseswswt'>Previous relevant <a target=_blank title='Apple Script Execution of Start Word Suggestions for Wordle Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-execution-of-start-word-suggestions-for-wordle-tutorial\/'>Apple Script Execution of Start Word Suggestions for Wordle Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Apple Script Execution of Start Word Suggestions for Wordle Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/apple_script_command_line_start_word_for_wordle_tailoring.gif\" title=\"Apple Script Execution of Start Word Suggestions for Wordle Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Apple Script Execution of Start Word Suggestions for Wordle Tutorial<\/p><\/div>\n<p>It&#8217;s 2022 as we write this blog post and these days your macOS operating systems no longer present you with the chance to create desktop shortcuts that run a program with user defined arguments.  But there is still <a target=_blank title='AppleScript information from Apple' href='https:\/\/developer.apple.com\/library\/archive\/documentation\/AppleScript\/Conceptual\/AppleScriptLangGuide\/introduction\/ASLR_intro.html'>Apple Script<\/a> as a possible methodology we can use, via the Apple Script &#8230;<\/p>\n<p><code><br \/>\ntell application \"Terminal\"<br \/>\n\tactivate<br \/>\n\tdo script \"cd ~\/Downloads\" in window 1<br \/>\n\tdo script \"open 'HTTP:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php?others=sort%20%20unique%20common%20&sugnum=7'\" in window 1<br \/>\nend tell<br \/>\n<\/code><\/p>\n<p> &#8230; we got <a target=_blank title='Great help, thanks' href='https:\/\/apple.stackexchange.com\/questions\/260867\/applescript-how-to-open-the-terminal-fullscreen-and-execute-commands'>great help<\/a>, thanks, in writing, that &#8230;<\/p>\n<ol>\n<li>starts Applications -&gt; Utilities Terminal application &#8230; and then it does not matter, especially, but we &#8230;<\/li>\n<li>change directory to the user&#8217;s Downloads folder &#8230; and then &#8230;<\/li>\n<li>issue the command line command &#8230;<br \/>\n<code><br \/>\nopen 'HTTP:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php?others=sort%20%20unique%20common%20&sugnum=7'<br \/>\n<\/code><br \/>\n &#8230; to open the same web application as for yesterday&#8217;s <a title='Start Word Suggestions for Wordle Intersessional Tutorial' href='#swswit'>Start Word Suggestions for Wordle Intersessional Tutorial<\/a> to tailor a set of &#8220;Start Word for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a>&#8221; words\n<\/li>\n<\/ol>\n<p>We saved the Apple Script above to our ~\/Desktop desktop ready to execute and be in the Apple Script environment, as you run the Apple Script that opens the web application.  We hope this interests some macOS users, now or into the future.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-execution-of-start-word-suggestions-for-wordle-tutorial\/'>Apple Script Execution of Start Word Suggestions for Wordle Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswit'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Intersessional Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-intersessional-tutorial\/'>Start Word Suggestions for Wordle Intersessional Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Sort Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_common.jpg\" title=\"Start Word Suggestions for Wordle Sort Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Intersessional Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-intranet-tutorial\/' title='English Word Guessing Game Intranet Tutorial'>English Word Guessing Game Intranet Tutorial<\/a>&#8216;s use of window.<a target=_blank title='window.localStorage information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a> methodologies got us rethinking the &#8220;Start Word for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a>&#8221; ideas in the recent <a title='Start Word Suggestions for Wordle Sort Tutorial' href='#swswst'>Start Word Suggestions for Wordle Sort Tutorial<\/a>&#8216;s web application.<\/p>\n<p>Those, again, Javascript <a target=_blank title='Javascript prompt window information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_prompt.asp'>prompt<\/a> window driven user interactions, are a tad annoying to handle, but if they could be &#8220;standing order&#8221;ised then that might help.  Here we need to store the setting in the web browser, hence the use of HTTP Cookies or window.<a target=_blank title='window.localStorage information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a> (or window.sessionStorage).<\/p>\n<p>Along the way, we wanted to offer another option, &#8220;common&#8221;, to be a user definable setting saying that words suggested would have to be &#8220;ridgy didge&#8221; in <a target=_blank title='The Free Dictionary' href='\/\/www.thefreedictionary.com'>The Free Dictionary<\/a>, thanks, lexicon.<\/p>\n<p>Getting this going, we realized this might take longer, and when the word &#8220;longer&#8221; comes into play, we (tend to) think <font size=1>(as you would)<\/font> &#8230;<\/p>\n<p><code><br \/>\ndocument.body.style.cursor='progress';<br \/>\n<\/code><\/p>\n<p> &#8230; to signal to the user that processing may take some time.  And for the first time we can remember, we were interested in floating to the right of that &#8220;spinning ball&#8221; <i>progress<\/i> cursor some reason for the wait, that being a (most likely rearranged) version of the Javascript <a target=_blank title='Javascript prompt window information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_prompt.asp'>prompt<\/a> window entry the user made.<\/p>\n<p>At the Javascript function <i>onl()<\/i> document.body &#8220;onload&#8221; event logic, <font color=blue>changes made<\/font> augment the new &#8220;just before &lt;\/body&gt;&#8221; &lt;div id=cwords&gt;&lt;\/div&gt; initially static HTML element &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  <font color=blue>var pointerX = -1;<br \/>\n  var pointerY = -1;<br \/>\n<br \/>\n  function pointerCheck() {<br \/>\n\tif (pointerX != -1) {<br \/>\n\t  document.getElementById('cwords').style.position='absolute';<br \/>\n\t  document.getElementById('cwords').style.top='' + eval(0 + eval('' + pointerY)) + 'px';<br \/>\n\t  document.getElementById('cwords').style.left='' + eval(30 + eval('' + pointerX)) + 'px';<br \/>\n\t  document.getElementById('cwords').style.zIndex='99';<br \/>\n\t  document.getElementById('cwords').style.backgroundColor='orange';<br \/>\n\t  document.getElementById('cwords').innerHTML=document.getElementById('lsbits').title;<br \/>\n\t}<br \/>\n  }<\/font><br \/>\n<br \/> <br \/>\n  function onl() {<br \/>\n   <font color=blue>if (('' + localStorage.getItem('start_word_for_wordle_helper')).replace(\/^null$\/g,'') != '') {<br \/>\n     document.getElementById('lsbits').title=decodeURIComponent(localStorage.getItem('start_word_for_wordle_helper')).replace('&sugnum=',' ').replace(encodeURIComponent('&sugnum='),' ');<br \/>\n     if (document.URL.indexOf('others=') == -1) {<br \/>\n       document.body.style.cursor='progress';<br \/>\n       document.onmousemove = function(event) {  \/\/ thanks to <a target=_blank title='https:\/\/www.codegrepper.com\/code-examples\/javascript\/get+cursor+position+javascript' href='https:\/\/www.codegrepper.com\/code-examples\/javascript\/get+cursor+position+javascript'>https:\/\/www.codegrepper.com\/code-examples\/javascript\/get+cursor+position+javascript<\/a><br \/>\n       if (event.clientX || event.clientY) {<br \/>\n        pointerX = event.clientX;<br \/>\n        pointerY = event.clientY;<br \/>\n       } else {<br \/>\n\t    pointerX = event.pageX;<br \/>\n\t    pointerY = event.pageY;<br \/>\n\t   }<br \/>\n       };<br \/>\n       setInterval(pointerCheck, 1000);<br \/>\n       location.href=(document.URL + '&others=' + (localStorage.getItem('start_word_for_wordle_helper'))).replace('.php&','.php?').replace(encodeURIComponent('&sugnum='),'&sugnum=');<br \/>\n     }<br \/>\n   }<\/font><br \/>\n<br \/>\n   if (window.self !== window.top) {<br \/>\n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2');<br \/>\n   }<br \/>\n   makesortable();<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; help make this happen.<\/p>\n<p>All this can give <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php----GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php----GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> an intersessional personalization feel to it.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-sort-tutorial\/'>New Start Word Suggestions for Wordle Sort Tutorial<\/a> ...<\/p>\n\n\n\n\n\n<hr>\n\n\n\n\n\n<p id='swswst'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Sort Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-sort-tutorial\/'>Start Word Suggestions for Wordle Sort Tutorial<\/a> is shown below.<\/p>\n\n\n\n[caption id=\"\" align=\"alignnone\" width=\"220\" caption=\"Start Word Suggestions for Wordle Sort Tutorial\"]<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Sort Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_sort.jpg\" title=\"Start Word Suggestions for Wordle Sort Tutorial\"  style=\"float:left;\"   \/><\/a>[\/caption]\n\n\n\n<p>The webpage created when you execute <a title='Start Word Suggestions for Wordle Iframe Tutorial' href='#swswit'>Start Word Suggestions for Wordle Iframe Tutorial<\/a>'s \"Start Word Suggestions for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a>\" <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">web application<\/a> features a pretty common and traditional form of HTML table element display.<\/p>\n\n\n\n\n\n<p>This HTML <a target=_blank title='HTML table element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_table.asp'>table<\/a> element can \"host\" children and grandchildren and great grandchildren ...<\/p>\n\n\n\n\n\n<ul>\n\n\n<li><a target=_blank title='HTML thead element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_thead.asp'>thead<\/a> (table header \"child\")<\/li>\n\n\n\n\n<li><a target=_blank title='HTML tbody element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_tbody.asp'>tbody<\/a> (table body \"child\" element ... some browsers create a tbody given the lack of a thead and the existence of element(s) below in the static HTML used)<\/li>\n\n\n\n\n<li><a target=_blank title='HTML tr element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_tr.asp'>tr<\/a> (table row \"grandchild\")<\/li>\n\n\n\n\n<li><a target=_blank title='HTML th element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_th.asp'>th<\/a> (table header cell \"great grandchild\")<\/li>\n\n\n\n\n<li><a target=_blank title='HTML td element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_td.asp'>td<\/a> (table body cell \"great grandchild\")<\/li>\n\n\n<\/ul>\n\n\n\n\n\n<p> ... and our table \"static HTML\" (ie. \"the static <font size=1>initial<\/font> design HTML\" before any Javascript DOM comes into play at or after the document.body \"onload\" event) involves \"tr\" and \"th\" and \"td\" elements above, and we become interested in massaging that <font size=1>(via Javascript DOM)<\/font> to host all \"tr -&gt; th\" elements within a derived \"thead\" and all \"tr -&gt; td\" elements within a derived \"tbody\" element, so that \"sorting functionality\" logic can consist of ...<\/p>\n\n\n\n\n\n<ol>\n\n\n<li>add onclick logic for \"th\" elements ... that can ...<\/li>\n\n\n\n\n<li>affect the \"tbody\" innerHTML's \"tr -&gt; td\" element content order ...<\/li>\n\n\n\n\n<li>toggling between \"from highest to lowest\" and \"from lowest to highest\"<\/li>\n\n\n<\/ol>\n\n\n\n\n\n<p> ... so that the scripting and styling code <font color=blue>now looks like<\/font> ...<\/p>\n\n\n\n&lt;?php \n<code>\n<font color=blue>$ondc=\" ondblclick=dictmaybe(this); \";\nif (isset($_GET['nodouble']) || isset($_POST['nodouble'])) { $ondc=\"\";   }<\/font>\n<br \/>\n$hsc=\"&lt;head&gt;\n&lt;title&gt;Start five letter word for Wordle - RJM Programming - February, 2022&lt;\/title&gt;\n&lt;meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' &gt;\n&lt;style&gt;\n  td { \n    text-align: center;\n  }\n<br \/>\n  td:nth-child(2n+1) {  \n    background-color: #f3f7fa;\n  }\n<br \/>\n  th:nth-child(2n+1) {  \n    background-color: #f3f7fa;\n  }\n<br \/>  \n  body {\n    background-color: #f7f7f7;\n  }\n&lt;\/style&gt;\n&lt;script type='text\/javascript'&gt;\n  var wois=null;\n  <font color=blue>var sortrecs=[];\n  var tables=[];\n  var tbodies=[];\n  var theads=[];\n  var ths=[];\n  var trs=[];\n  var tds=[];\n  var parti=0;\n  var lessis=1;\n  var tabih='';\n  var woare=null;\n  var adc=null;<\/font>\n<br \/>  \n  function onl() {\n   if (window.self !== window.top) { \n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2'); \n   }\n   <font color=blue>makesortable();<\/font>\n  }\n<br \/>  \n  <font color=blue>function gebtn() {\n   theads=document.<a target=_blank title='Javascript DOM getElementsByTagName() method information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/met_document_getelementsbytagname.asp'>getElementsByTagName<\/a>('thead');\n   tables=document.getElementsByTagName('table');\n   trs=document.getElementsByTagName('tr');\n   tds=document.getElementsByTagName('td');\n   tbodies=document.getElementsByTagName('tbody');\n   ths=document.getElementsByTagName('th');\n  }\n<br \/>  \n  function makesortable() {\n   var itd=0;\n   var jtd=0;\n   var recis='';\n   var thisih='';\n   var nonhead='';\n   var origsrl=eval(sortrecs.length);\n   gebtn();\n   if (eval('' + theads.length) == 0 && eval('' + tbodies.length) &gt; 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0 && eval('' + ths.length) &gt; 0 && eval('' + trs.length) &gt; 0) {\n     if (tables[0].innerHTML.indexOf('&lt;tbody&gt;') != -1) {\n      tables[0].innerHTML=tables[0].innerHTML.replace('&lt;tbody&gt;','').replace('&lt;\/tbody&gt;','').replace(trs[0].outerHTML, '&lt;thead&gt;' + trs[0].outerHTML + '&lt;\/thead&gt;');\n      theads=document.getElementsByTagName('thead');\n      tbodies=document.getElementsByTagName('tbody');\n     }\n   }\n   if (eval('' + tbodies.length) == 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0) {\n     if (eval('' + ths.length) &gt; 0 && eval('' + trs.length) &gt; 0) {\n       if (eval('' + theads.length) &gt; 0) {\n         nonhead=tables[0].innerHTML.replace(theads[0].outerHTML,'');\n       } else {\n         nonhead=tables[0].innerHTML.replace(trs[0].outerHTML,'');\n       }\n       if (nonhead != '') {\n         tables[0].innerHTML=tables[0].innerHTML.replace(nonhead, '&lt;tbody id=mytbody&gt;' + nonhead + '&lt;\/tbody&gt;');\n         tbodies=document.getElementsByTagName('tbody');\n       }\n     }\n   } \n   if (eval('' + tbodies.length) &gt; 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0) {\n     if (eval('' + ths.length) &gt; 0 && eval('' + trs.length) &gt; 0) {\n       recis='';\n       for (itd=0; itd&lt;eval('' + tds.length); itd+=eval('' + ths.length)) {\n         if (itd == 0) {\n           for (jtd=0; jtd&lt;eval('' + ths.length); jtd++) {\n            ths[jtd].title='Click this column ' + eval(1 + jtd) + ' to sort from highest to lowest.';\n            ths[jtd].onclick = function() { sortcol(this);  };\n           }\n         }\n         for (jtd=itd; jtd&lt;eval(itd + eval('' + ths.length)); jtd++) {\n         thisih=tds[jtd].innerHTML;\n         if (thisih.trim() != '') {\n           if (thisih.trim().replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {\n             recis+=('                    ' + thisih).slice(-20);\n           } else {\n             recis+=(thisih + '                    ').substring(0,20);\n           }\n         } else {\n           recis+='                    ';\n         }\n         if (eval(eval(1 + jtd) % eval('' + ths.length)) == 0) {\n           if (origsrl == 0) { sortrecs.push(recis); }\n           recis='';\n         }\n         }\n       }\n     }\n     if (origsrl == 0) { \n       tabih=tables[0].innerHTML;\n       tables[0].ondblclick = function() { tables[0].innerHTML=tabih; makesortable();  };\n       tables[0].title='Double click me to restore to original sort order.'; \n     }\n   }\n  }\n<br \/>  \n  function compareparts(a, b) {\n    if (a.substring(eval(20 * parti),eval(20 + eval(20 * parti))) == b.substring(eval(20 * parti),eval(20 + eval(20 * parti)))) { \n      if (parti &gt; 0) {  \n        if (a.substring(0,eval(20 * parti)) &lt; b.substring(0,eval(20 * parti))) { \n          return lessis; \n        } else if (a.substring(0,eval(20 * parti)) &gt; b.substring(0,eval(20 * parti))) { \n          return -lessis; \n        } \n      }\n      return 0; \n    }\n    if (a.substring(eval(20 * parti),eval(20 + eval(20 * parti))) &lt; b.substring(eval(20 * parti),eval(20 + eval(20 * parti)))) { return lessis; }\n    return -lessis;\n  }\n<br \/>  \n  function dictmaybe(intdo) {\n    if (('' + intdo.innerHTML) != '' && ('' + intdo.innerHTML).replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') != '') {\n     if (woare) {  if (!woare.closed) {  woare.close(); woare=null;  }  }\n     woare=window.open('\/\/www.thefreedictionary.com\/' + encodeURIComponent(intdo.innerHTML), '_blank', 'top=100,left=' + eval(eval('' + screen.width) \/ 2) + ',width=' + eval(eval('' + screen.width) \/ 2) + ',height=600');\n    }\n  }\n<br \/>  \n  function sortcol(tho) {\n   var ij=0;\n   var kl=0;\n   var tb='';\n   parti=0;\n   if (('' + tho.title).indexOf('Click this column ') == 0 && ('' + tho.title).indexOf(' to sort from ') != -1) {\n     parti=eval(-1 + eval(('' + tho.title).split('Click this column ')[1].split(' ')[0]));\n     if (eval('' + tbodies.length) &gt; 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0) {\n       if (('' + tho.title).indexOf(' highest to lowest') != -1) {\n         sortrecs.sort(compareparts);\n         for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n           ths[ij].title=ths[ij].title.replace(' highest to lowest', ' lowest to highest');\n         }\n         tb='';\n         for (kl=0; kl&lt;eval('' + sortrecs.length); kl++) {\n           tb+='&lt;tr&gt;&lt;\/tr&gt;';\n           for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n             tb=tb.replace('&lt;\/tr&gt;', '&lt;td\" . $ondc . \"&gt;' + sortrecs[kl].substring(eval(20 * ij),eval(20 + eval(20 * ij))).trim() + '&lt;\/td&gt;&lt;\/tr&gt;');\n           }\n           tb=tb.replace('&lt;\/tr&gt;', '&lt;\/TR&gt;');\n         }\n         lessis=-lessis;\n       } else {\n         sortrecs.sort(compareparts);\n         for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n           ths[ij].title=ths[ij].title.replace(' lowest to highest', ' highest to lowest');\n         }\n         tb='';\n         for (kl=0; kl&lt;eval('' + sortrecs.length); kl++) {\n           tb+='&lt;tr&gt;&lt;\/tr&gt;';\n           for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n             tb=tb.replace('&lt;\/tr&gt;', '&lt;td\" . $ondc . \"&gt;' + sortrecs[kl].substring(eval(20 * ij),eval(20 + eval(20 * ij))).trim() + '&lt;\/td&gt;&lt;\/tr&gt;');\n           }\n           tb=tb.replace('&lt;\/tr&gt;', '&lt;\/TR&gt;');\n         }\n         lessis=-lessis;\n       }\n       tbodies[0].innerHTML=tb.replace('&lt;\/tr&gt;', '&lt;\/TR&gt;');\n     }\n   }\n  }<\/font>\n<br \/>\n  function mixitup() {\n   var others=prompt('Space separate the word(s) \\\"sort\\\" to sort for Weirdness and\/or \\\"unique\\\" for five letter words with no repeated letters.   Optionally precede by that number of five letter word suggestions to create for use with Wordle, followed by a space character.', '');\n   var clickthis='';\n   if (others == null) { others=''; }\n   others=others.replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'');\n   others=others.toLowerCase().replace('sort',' sort').replace('uniqu',' uniqu');\n   if (others.trim() != '') {\n     var aothers=others.trim().split(' ');\n     if (aothers[0].replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {\n        document.getElementById('defopt').value='-' + aothers[0];\n        document.getElementById('defopt').innerHTML=aothers[0];\n        document.getElementById('sugnum').value='-' + aothers[0];\n        others=others.replace(aothers[0],'').trim();\n        clickthis='mysub';\n     }\n   }\n   if (others.trim() != '') {\n     var sv=document.getElementById('sugnum').value;\n     document.getElementById('myform').innerHTML+='&lt;input type=hidden name=others value=\\\"' + others + '\\\"&gt;&lt;\/input&gt;';\n     document.getElementById('sugnum').value=sv;\n   }\n   if (clickthis != '') {  document.getElementById(clickthis).click();  }\n  }\n<br \/>    \n&lt;\/script&gt;\n&lt;\/head&gt;\";\n<\/code>\n?&gt;\n\n\n\n<p> ... that augments that \"th\" \"onclick\" event logic with some non-mobile \"ondblclick\" event logic ...<\/p>\n\n\n\n\n\n<ul>\n\n\n<li>for \"table\" that unscrambles any sorting ...<\/li>\n\n\n\n\n<li>for \"td\" cells whose content is not numeric, look up <a target=_blank title='The Free Dictionary' href='\/\/www.thefreedictionary.com'>The Free Dictionary<\/a>, thanks, to try to explain word meanings<\/li>\n\n\n<\/ul>\n\n\n\n\n\n<p> ... for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php---GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php---GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, \"Start Word for Wordle\" web application.<\/p>\n\n  \n\n<!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-sort-tutorial\/'>Start Word Suggestions for Wordle Sort Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswit'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Iframe Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-tutorial\/'>Start Word Suggestions for Wordle Iframe Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Iframe Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_iframe.jpg\" title=\"Start Word Suggestions for Wordle Iframe Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Iframe Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Start Word Suggestions for Wordle Styling and Scripting Tutorial' href='#swswsst'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a>&#8216;s presentation used a hashtag navigation link, &#8220;<a href='#myswh' title='Below'>or below<\/a>&#8220;, to take the user to an HTML iframe hosted execution of our current web application of interest.   Sometimes in such a scenario, you might be dealing with a vastly reduced width and\/or height to work with, and find your presentation to this iframe appears a bit too wide or too high.  And so, today, we outline an idea or two about how to handle that.<\/p>\n<ol>\n<li>decide on a strategy for &#8220;iframe&#8221; modus operandi CSS styling improvement or HTML design improvement or Javascript DOM dynamic styling improvement &#8230; we&#8217;ve decided, today &#8230;<\/li>\n<li>for &#8220;iframe&#8221; modus operandi we want to reduce width by turning the &#8220;h1&#8221; element into an &#8220;h2&#8221; element &#8230; which amounts to an <i>HTML design improvement<\/i> implemented via a Javascript DOM action conduit, as per &#8230;<\/li>\n<li>decide on an intervention point for that <i>Javascript DOM action conduit<\/i> &#8230; you guessed it &#8230; document.body onload event <font color=blue>as the webpage loads<\/font> &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\necho \"&lt;html&gt;\" . $hsc . \"&lt;body<font color=blue> onload=onl();<\/font>&gt;&lt;h1&gt;&lt;span&gt;Start five letter word for &lt;a target=_blank href='\/\/www.powerlanguage.co.uk\/wordle\/'&gt;Wordle&lt;\/a&gt; ... &lt;\/span&gt;&lt;input onclick=mixitup(); title='Allow for Unique Letters, Weirdness Sorting' type=button style=display:inline-block; value='via '&gt;&lt;\/input&gt;&lt;\/span&gt;&lt;form id=myform style=display:inline-block; action=.\/start_word_for_wordle_helper.php method=POST&gt;&lt;input id=mysub type=submit value=Submit style=display:none;&gt;&lt;\/input&gt;&lt;select style=display:inline-block; id=sugnum name=sugnum onchange=document.getElementById('mysub').click();&gt;&lt;option id=defopt value=-\" . $sugnum . \"&gt;\" . $sugnum . \"&lt;\/option&gt;&lt;option value=1&gt;1&lt;\/option&gt;&lt;option value=2&gt;2&lt;\/option&gt;&lt;option value=3&gt;3&lt;\/option&gt;&lt;option value=4&gt;4&lt;\/option&gt;&lt;option value=5&gt;5&lt;\/option&gt;&lt;option value=6&gt;6&lt;\/option&gt;&lt;option value=7&gt;7&lt;\/option&gt;&lt;option value=8&gt;8&lt;\/option&gt;&lt;option value=9&gt;9&lt;\/option&gt;&lt;option value=10&gt;10&lt;\/option&gt;&lt;option value=20&gt;20&lt;\/option&gt;&lt;option value=25&gt;25&lt;\/option&gt;&lt;option value=50&gt;50&lt;\/option&gt;&lt;option value=100&gt;100&lt;\/option&gt;&lt;\/select&gt;&lt;span&gt; suggestions ...&lt;\/span&gt;&lt;\/h1&gt;&lt;h3&gt;RJM Programming ... February, 2022&lt;\/h3&gt;&lt;h4&gt;Suggestions below (bigger associated number, the weirder is the suggestion) ...&lt;\/h4&gt;&lt;br&gt;\" . $tablebit . \"&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; then &#8230;<\/li>\n<li>write the new Javascript document.body onload event logic &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  function onl() {<br \/>\n   if (window.self !== window.top) {<br \/>\n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2');<br \/>\n   }<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; a total &#8220;document.body.innerHTML&#8221; (content) solution working here (but is not always a good solution) to change the &#8220;type&#8221; of an element\n<\/li>\n<\/ol>\n<p> &#8230; representing a &#8220;hosting mode of use&#8221; style variation with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php--GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php--GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, web application!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-tutorial\/'>Start Word Suggestions for Wordle Iframe Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswsst'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Styling and Scripting Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-styling-and-scripting-tutorial\/'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Styling and Scripting Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.gif\" title=\"Start Word Suggestions for Wordle Styling and Scripting Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Start Word Suggestions for Wordle Primer Tutorial' href='#swswpt'>Start Word Suggestions for Wordle Primer Tutorial<\/a> proof of concept &#8220;Start Five Letter Word for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a> Suggester&#8221; web application managed to create a workable webpage that did not need a <a target=_blank title='HTML head element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_head.asp'>&#8220;head&#8221;<\/a> element.  What are you missing with no &#8220;head&#8221; element?  Primarily &#8230;<\/p>\n<ul>\n<li>scripting (usually <a target=_blank title='HTML script element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_script.asp'>via<\/a> Javascript)<\/li>\n<li>styling (<a target=_blank title='HTML style element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_style.asp'>via<\/a> CSS)<\/li>\n<\/ul>\n<p> &#8230; and, perhaps a webpage title element, and, perhaps <a target=_blank title='HTML meta element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_meta.asp'>&#8220;meta&#8221;<\/a> elements like <a target=_blank title='HTML responsive design information from W3schools' href='https:\/\/www.w3schools.com\/css\/css_rwd_viewport.asp'>&#8220;meta viewport&#8221;<\/a> elements that help with mobile device display (improved visibility, for us).<\/p>\n<p>Within the PHP code we introduced some of all these improvements via &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$hsc=\"&lt;head&gt;<br \/>\n&lt;title&gt;Start five letter word for Wordle - RJM Programming - February, 2022&lt;\/title&gt;<br \/>\n&lt;meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' &gt;<br \/>\n&lt;style&gt;<br \/>\n  td {<br \/>\n    text-align: center;<br \/>\n  }<br \/>\n<br \/>\n  td:nth-child(2n+1) {<br \/>\n    background-color: #f3f7fa;<br \/>\n  }<br \/>\n<br \/>\n  th:nth-child(2n+1) {<br \/>\n    background-color: #f3f7fa;<br \/>\n  }<br \/>\n<br \/> <br \/>\n  body {<br \/>\n    background-color: #f7f7f7;<br \/>\n  }<br \/>\n&lt;\/style&gt;<br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n  var wois=null;<br \/>\n  function mixitup() {<br \/>\n   var others=prompt('Space separate the word(s) \\\"sort\\\" to sort for Weirdness and\/or \\\"unique\\\" for five letter words with no repeated letters.   Optionally precede by that number of five letter word suggestions to create for use with Wordle, followed by a space character.', '');<br \/>\n   var clickthis='';<br \/>\n   if (others == null) { others=''; }<br \/>\n<br \/>   others=others.replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'');<br \/>\n   others=others.toLowerCase().replace('sort',' sort').replace('uniqu',' uniqu');<br \/>\n   if (others.trim() != '') {<br \/>\n     var aothers=others.trim().split(' ');<br \/>\n     if (aothers[0].replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {<br \/>\n        document.getElementById('defopt').value='-' + aothers[0];<br \/>\n        document.getElementById('defopt').innerHTML=aothers[0];<br \/>\n        document.getElementById('sugnum').value='-' + aothers[0];<br \/>\n        others=others.replace(aothers[0],'').trim();<br \/>\n        clickthis='mysub';<br \/>\n     }<br \/>\n   }<br \/>\n   if (others.trim() != '') {<br \/>\n     var sv=document.getElementById('sugnum').value;<br \/>\n     document.getElementById('myform').innerHTML+='&lt;input type=hidden name=others value=\\\"' + others + '\\\"&gt;&lt;\/input&gt;';<br \/>\n     document.getElementById('sugnum').value=sv;<br \/>\n   }<br \/>\n   if (clickthis != '') {  document.getElementById(clickthis).click();  }<br \/>\n  }<br \/>\n<br \/> <br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p>It allows us to offer &#8220;sort&#8221; (via word weirdness) and &#8220;uniquify&#8221; (to enforce unique letter sets per five letter word) additional functionality.  We hope you try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php-GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php-GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, to try out these improvements.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-styling-and-scripting-tutorial\/'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswpt'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-primer-tutorial\/'>Start Word Suggestions for Wordle Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.jpg\" title=\"Start Word Suggestions for Wordle Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Primer Tutorial<\/p><\/div>\n<p>A new word game is an interesting phenomenon.  Are you a regular <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>&#8220;Wordle&#8221;<\/a> player?  We tried it the other day, and see why it&#8217;s addictive.  But it seems to us, a lot relies on that first five letter word guess you make.<\/p>\n<p>And so we decided to try to help out, at least in English, by accessing the macOS and Linux dictionary resources, and add in a &#8220;weirdness score&#8221;, the scoring for which we adopt a &#8220;Scrabble stance&#8221;.   Interested?  Try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\">live run<\/a>, or below &#8230;<\/p>\n<p><iframe id=myswh src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php?others=10sortunique\" style=\"width:100%;height:800px;\"><\/iframe><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54864' onclick='var dv=document.getElementById(\"d54864\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/word\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54864' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54868' onclick='var dv=document.getElementById(\"d54868\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54868' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54880' onclick='var dv=document.getElementById(\"d54880\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/type\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54880' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54899' onclick='var dv=document.getElementById(\"d54899\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/sort\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54899' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54949' onclick='var dv=document.getElementById(\"d54949\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/intersession\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54949' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54956' onclick='var dv=document.getElementById(\"d54956\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/applescript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54956' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55082' onclick='var dv=document.getElementById(\"d55082\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/desktop\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55082' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55090' onclick='var dv=document.getElementById(\"d55090\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/schedule\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55090' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The focus of yesterday&#8217;s Apple Script macOS Desktop Application Primer Tutorial was on &#8230; an interactive macOS desktop application mode of use &#8230; but there are many reasons you might prefer a &#8220;scheduled&#8221; rather than &#8220;interactive&#8221; mode of use. We &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/apple-script-macos-desktop-application-scheduled-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[91,94,96,155,272,274,319,320,380,725,2178,738,2738,996,997,1893,1105,1166,3927,2086,3926,1319],"class_list":["post-55090","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-apple","tag-applescript","tag-application","tag-body","tag-cron","tag-crontab","tag-desktop","tag-desktop-application","tag-email","tag-mac-os-x","tag-macos","tag-mail","tag-procedure","tag-program","tag-programming","tag-schedule","tag-script","tag-software-2","tag-standalone","tag-subject","tag-take","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55090"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=55090"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55090\/revisions"}],"predecessor-version":[{"id":55101,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55090\/revisions\/55101"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=55090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=55090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=55090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}