Myriad Tables Questions

It works in that it gets converted to an integer when bridged, but using an integer is arguably more correct. Checkboxes aren’t always boolean in nature, in that they can be configured to have an indeterminate state (signified by a negative integer).

Sounds like a feature request.

Yes, come to think of it, that’s exactly what that sounds like :sunglasses:

yes, in one case I’ve used the extra button to do this, but in other cases I’ve run out of buttons so I guess I’ll have to dive into the murky world of accessory views. :grimacing: Thanks for the suggestion!

Here’s another question that could be come a feature request or two.

Is it possible for an MT table launched while a specific application is running to only be visible when that application is frontmost/active? Lots of apps have palettes that behave that way.

Ideally I’d like to have an MT Table that changes the displayed list based on which app is frontmost.

I’m using MT to create script palettes. I’m finding them potentially easier to use and definitely faster to execute than FastScripts; apple’s script menu or even script palettes and menus in some apps (inDesign; TextWranger; Script Debugger).

That’s something you have to control from your app. It’s not that hard to do — there’s a chapter about it in my book (chapter 16).

Feature request:

With empty selection allowed set to false, the extra button, if it is present, should still be enabled/clickable. Or at least the behaviour of the extra button should be controlled independently of the behaviour of the OK button.

But then empty selection would be allowed.

Can you give me examples of how that might be useful? It does add a significant amount of extra complication, so there’d have to be more value than just saving a follow-up dialog for invalid entry.

I often use the extra button as a “Refresh,” which gets a new set of table data to display.

For example, say the user is selecting a file to download from a list of files on the server. This would give the user the option of refreshing the list to see any new files added without having to select an item to download that the user doesn’t want to download.

It looks like if there are duplicate values in a popup menu in myriad tables, the first instance is removed, is that correct?

I’m trying to make this work easier for the user. Most of the selections in this list would Sunday’s; but a few of them would be weekdays (which may or may not include Sunday), and several would always be Wednesdays.

So the effect I’m trying to get is for the popup menu to display the next three Sundays; then every day of the week (including Sundays) below.

Instead it displays the full list without Sundays.

Is removing the first instance of duplicates at the beginning of a popup list intentional?

I’d prefer to display them with dupes, or if that’s not practical, keep the first instance and remove subsequent instances.

use scripting additions
use script "Myriad Tables Lib" version "1.0.7"
set rowTemplate to {"", {popup menu, {"Sunday, July 7, 2019", ¬
   "Sunday, July 14, 2019", ¬
   "Sunday, July 21, 2019", ¬
   "Sunday, July 7, 2019", ¬
   "Monday, July 8, 2019", ¬
   "Tuesday, July 9, 2019", ¬
   "Wednesday, July 10, 2019", ¬
   "Thursday, July 11, 2019", ¬
   "Friday, July 12, 2019", ¬
   "Saturday, July 13, 2019", ¬
   "Sunday, July 14, 2019", ¬
   "Monday, July 15, 2019", ¬
   "Tuesday, July 16, 2019", ¬
   "Wednesday, July 17, 2019", ¬
   "Thursday, July 18, 2019", ¬
   "Friday, July 19, 2019", ¬
   "Saturday, July 20, 2019", ¬
   "Sunday, July 21, 2019", ¬
   "Monday, July 22, 2019", ¬
   "Tuesday, July 23, 2019", ¬
   "Wednesday, July 24, 2019", ¬
   "Thursday, July 25, 2019", ¬
   "Friday, July 26, 2019", ¬
   "Saturday, July 27, 2019"}}}
set {dateList, firstSunday, firstWednesday, firstDate, sundayList} to {{"Sunday, July 7, 2019", ¬
   "Monday, July 8, 2019", ¬
   "Tuesday, July 9, 2019", ¬
   "Wednesday, July 10, 2019", ¬
   "Thursday, July 11, 2019", ¬
   "Friday, July 12, 2019", ¬
   "Saturday, July 13, 2019", ¬
   "Sunday, July 14, 2019", ¬
   "Monday, July 15, 2019", ¬
   "Tuesday, July 16, 2019", ¬
   "Wednesday, July 17, 2019", ¬
   "Thursday, July 18, 2019", ¬
   "Friday, July 19, 2019", ¬
   "Saturday, July 20, 2019", ¬
   "Sunday, July 21, 2019", ¬
   "Monday, July 22, 2019", ¬
   "Tuesday, July 23, 2019", ¬
   "Wednesday, July 24, 2019", ¬
   "Thursday, July 25, 2019", ¬
   "Friday, July 26, 2019", ¬
   "Saturday, July 27, 2019"}, ¬
   "Sunday, July 14, 2019", ¬
   "Wednesday, July 10, 2019", ¬
   "Monday, July 8, 2019", ¬
   {"Sunday, July 7, 2019", ¬
      "Sunday, July 14, 2019", ¬
      "Sunday, July 21, 2019"}}
set dateListPubList to {}

set the end of dateListPubList to {"What's on TV Coverage Plan", firstSunday}
set the end of dateListPubList to {"What's on TV", firstDate}
set the end of dateListPubList to {"Calendar Letters", firstSunday}
set the end of dateListPubList to {"What's on TV This Week", firstSunday}
set the end of dateListPubList to {"TV Ratings", firstWednesday}
set tableData to dateListPubList

set tableTitle to ""
set tableResult to display table with data tableData ¬
   with title tableTitle row template rowTemplate

return values selected of tableResult

Not really. I’m using the popup menu’s additemsWithTitles: method, and I didn’t read the fine print:

Each string in the array should be unique. If an item with the same title already exists in the menu, the existing item is removed and the new one is added.

I’ll add it to my list of things to fix next time. In the meantime perhaps you can add bullets or something to the first entries.

Got it, thanks! Bullets could work!

So version 1.1.10 is now available here:

https://www.macosxautomation.com/applescript/apps/Script_Libs.html

It adds this change, and has another minor change to deal with a bug in the AppleScript compiler when using the term reference.

1 Like

I know this is an older thread but can you suggest how to format the dialog to display popups and checkboxes before the table?

It can’t be done — they have to go below.

Is there a way to put the table into a sheet?

Happy New Year
Dean

No. If your table needs aren’t too complex, you could look to some of the code @Piyomaru has used here:

http://piyocast.com/as/

Otherwise Xcode is your best bet.

I’m using a two monitor system and I’m finding MT very inconsistent in positioning the tables. Most of the time it works, putting the table exactly where the script tells it too (I grab the final position and use that for the initial position).

But sometimes (half the time?) it displays the window in the wrong monitor (but in the correct h/v position as if it were in the correct monitor. This happens with Google Chrome and InDesign, for sure and probably other apps, but I’m using it with those two a lot.

Is there any trick to get the table window to always display in the same place on the same monitor?

Do you have some sample code we can use to test on our systems?

I do have sample code. I’ll post shortly.

In the meantime I’ve just discovered that if the triggers opening a window or a dialog before redisplaying the table, then it repositions on the wrong monitor.

Positioning is done, and calculated, based on the system’s mainScreen, which is defined as the screen containing the window with keyboard focus. So if a script changes mainScreen, the dialog will swap screens next time it appears.

I don’t see any satisfactory alternative that isn’t much more complex from both the user’s and my point of view.