{"id":24,"date":"2010-12-27T15:49:24","date_gmt":"2010-12-27T23:49:24","guid":{"rendered":"http:\/\/sibr.com\/blog\/?p=24"},"modified":"2010-12-27T15:49:24","modified_gmt":"2010-12-27T23:49:24","slug":"display-large-type-window-a-la-address-book","status":"publish","type":"post","link":"http:\/\/sibr.com\/blog\/2010\/12\/27\/display-large-type-window-a-la-address-book\/","title":{"rendered":"Display Large Type window \u00e0 la Address Book"},"content":{"rendered":"<p>There&#8217;s a few times I would&#8217;ve like to prominently display a phone number or some other piece of information from a script or FileMaker. Apple&#8217;s Address Book application makes good use of this. If you right-click on a phone number you get this:<\/p>\n<p><a href=\"http:\/\/sibr.com\/blog\/wp-content\/uploads\/2010\/12\/window-example2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-27\" title=\"window example\" src=\"http:\/\/sibr.com\/blog\/wp-content\/uploads\/2010\/12\/window-example2.png\" alt=\"\" width=\"647\" height=\"114\" \/><\/a><\/p>\n<p>There&#8217;s a nice utility by the name of BigHonkingText that comes pretty close to this, but you must execute it via the command line, and has a few small differences from Address Book in its implementation<\/p>\n<p>Since I was hoping for an all AppleScript solution and was trying to get as close a match as possible, I&#8217;ve cooked up an app of my own for this.<\/p>\n<p>Called Gooey Gadgets, it is a faceless &#8220;helper&#8221; applcation that has the following commands:<\/p>\n<div><strong>dismiss window<\/strong> v\u00a0:\u00a0close given window<\/div>\n<div><strong>&nbsp;dismiss window<\/strong> integer :\u00a0the window number to close<\/div>\n<div>&nbsp;&nbsp;\u2192 boolean :\u00a0returns true if the window was found<\/div>\n<p><\/p>\n<div><strong>display message window<\/strong> v\u00a0:\u00a0Create a translucent window with one line message<\/div>\n<div><strong>&nbsp;display message window<\/strong> text :\u00a0a brief message to display<\/div>\n<div><strong>&nbsp;&nbsp;[giving up after<\/strong>\u00a0integer]:\u00a0number of seconds to wait before dismissing window<\/div>\n<div><strong>&nbsp;&nbsp;[screen<\/strong>\u00a0point]:\u00a0X,Y coordinates for any point within screen to be used to display the window<\/div>\n<div><strong>&nbsp;&nbsp;[transparency<\/strong>\u00a0integer]:\u00a0the window&#8217;s background transparency (alpha) as a percentage<\/div>\n<div>&nbsp;&nbsp;\u2192 integer :\u00a0the window id<\/div>\n<div>\n<ul>\n<li>The\u00a0<strong>screen<\/strong> coordinates are an optional value that you can use to make sure the message displays on the same screen as your other script or Filemaker windows. However they are in the coordinate system that Cocoa uses, which has the inverse Y-axis from what Filemaker uses for Get (WindowTop).<\/li>\n<li>The\u00a0<strong>giving up after<\/strong> parameter works the same way as Applescript&#8217;s\u00a0<strong>Display Dialog<\/strong> command, allowing you to set a maximum time for the window to display (the user may click on the window to dismiss it before then).<\/li>\n<li>The\u00a0<strong>transparency<\/strong> parameter is not yet implemented, so its value is ignored.<\/li>\n<\/ul>\n<\/div>\n<div>An example of its usage looks like this:<\/div>\n<blockquote>\n<div><strong>tell<\/strong> <em>application<\/em> id\u00a0&#8220;com.sibr.gooeygadgets&#8221;\u00a0&#8212; could&#8217;ve also used app name instead<\/div>\n<div><strong>&nbsp;set<\/strong> x\u00a0<strong>to<\/strong> <strong>display message window<\/strong> &#8220;big message&#8221;<\/div>\n<div><strong>&nbsp;delay<\/strong> 4<\/div>\n<div><strong>&nbsp;dismiss window<\/strong> x\u00a0&#8212; Gooey Gadgets will now quit if this is the last open window<\/div>\n<div><strong>end tell<\/strong><\/div>\n<\/blockquote>\n<div>\n<p><strong> <\/strong><\/p>\n<\/div>\n<div>I have also included command line support, and the options look like this:<\/div>\n<div><strong>Gooey Gadgets.app\/Contents\/MacOS\/Gooey Gadgets -cmd messagewindow [-giveup seconds] [-screenx num] [-screeny num]\u00a0<span style=\"text-decoration: underline;\">message<\/span><\/strong><\/div>\n<p><\/p>\n<div>The path used is an artifact of the fact that the command line must execute the actual application binary, not the application&#8217;s package folder. So if the application is at \/_Projects, a command line example would be:<\/div>\n<blockquote><p>\n<code>\/_Projects\/Gooey\\ Gadgets\/build\/Release\/Gooey\\ Gadgets.app\/Contents\/MacOS\/Gooey\\ Gadgets -cmd messagewindow -giveup 2 \"(510) 835-4483\"<\/code><\/p>\n<div>\n<div>\n<p><span style=\"font-family: Verdana;\"><strong> <\/strong><\/span><\/p>\n<p><strong> <\/strong><\/p>\n<\/div>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/blockquote>\n<p>Download the most recent version at:<\/p>\n<p><a title=\"Gooey Gadgets download\" href=\"http:\/\/sibr.com\/downloads\/Gooey Gadgets.zip\">Gooey Gadgets.app.zip<\/a><\/p>\n<p>After downloading, move it out of your Downloads folder. The first time you run it, you may need to OK the application as safe to run.<\/p>\n<div>PS: Excuse the formatting messiness above. The blog software wasn&#8217;t kind to my cut-and-pasting.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a few times I would&#8217;ve like to prominently display a phone number or some other piece of information from a script or FileMaker. Apple&#8217;s Address Book application makes good use of this. If you right-click on a phone number you get this: There&#8217;s a nice utility by the name of BigHonkingText that comes pretty &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/sibr.com\/blog\/2010\/12\/27\/display-large-type-window-a-la-address-book\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Display Large Type window \u00e0 la Address Book&#8221;<\/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":[2,3,4],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-applescript-2","category-scripting-addition","category-user-interface"],"_links":{"self":[{"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":0,"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"wp:attachment":[{"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sibr.com\/blog\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}