{"id":1314,"date":"2022-03-03T12:45:14","date_gmt":"2022-03-03T19:45:14","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=1314"},"modified":"2022-03-03T12:45:14","modified_gmt":"2022-03-03T19:45:14","slug":"automating-adding-comments","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2022\/03\/03\/automating-adding-comments\/","title":{"rendered":"Automating adding comments"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In Xojo I often need to add in a comment about when I modified something or what I was working on<br>And the comment needs to be in a particular format &#8211; and it needs the current date &amp; time as part of the comment<br>And, I want to be able to insert these EASILY into whatever code I&#8217;m working on right where the insertion point is<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this I came up with this IDE Script that I saved in my Scripts dir next to the IDE<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dim stripped As String\nstripped = DoShellCommand(\"echo \"\"\/\/ Updated `\/bin\/date \"\"+%Y-%m-%d %H:%M:%S %Z\"\"` -- NJP\"\" | \/usr\/bin\/tr -C -d \"\"&#91;:print:]\"\" | \/usr\/bin\/pbcopy -Prefer txt\")\n\nDoCommand(\"Paste\")\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">this will make use of the DoShellCommand to get the unix shell to write a line with the current date in it, copy that to the clipboard, and then paste it right where the insertion point is <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can modify the unix shell commands used to do just about whatever else you want<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Xojo I often need to add in a comment about when I modified something or what I was working onAnd the comment needs to be in a particular format &#8211; and it needs the current date &amp; time as part of the commentAnd, I want to be able to insert these EASILY into whatever &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2022\/03\/03\/automating-adding-comments\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Automating adding comments&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-1314","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=1314"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1314\/revisions"}],"predecessor-version":[{"id":1315,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1314\/revisions\/1315"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=1314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=1314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=1314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}