Myriad Tables Questions

is mainscreen something we can get/set?

Hereā€™s a sample. OMM, it always launches on the left screen, then switches to the right, SD and SE

The thing is I like to fill the screen with what Iā€™m working on and use MT as a script palette to launch scripts from the other window.

use framework "Foundation"
use AppleScript version "2.4"
use scripting additions
use script "Myriad Tables Lib"
property initialPosition : {50, 50}
set initialPosition to {50, 50}
set AppleScript's text item delimiters to {","}
set x to 1
set promptText to (x as text) & ". First displays at {50, 50}"

repeat
   set tableData to {Ā¬
      {"set TableReply to display table with data AnythingList ", ""}, Ā¬
      {"with title titleText ", ""}, Ā¬
      {"with prompt promptText ", ""} Ā¬
         }
   
   set tableData to make new table with data tableData Ā¬
      with prompt promptText Ā¬
      with double click means OK
   
   
   modify table tableData Ā¬
      initial position initialPosition
   
   set tableData to display table tableData Ā¬
      with extended results
   
   set initialPosition to final position of result
   set x to x + 1
   set promptText to (x as text) & (". Next Display {" & initialPosition as text) & "}"
   if x > 3 then display dialog promptText & return & return & "as a dialog"
end repeat

Thanks for posting an example, Ed.

Running Script Debugger 7.0.12 (7A112) on macOS 10.14.6 (Mojave).
My Screens (iMac-27 and one external monitor):
[Screen 1][Screen 2]
both 2560 x 1440

When I use Keyboard Maestro, I address the start of Screen 2 at 2560,0

I donā€™t know what ā€œSDā€ and ā€œSEā€ mean.
But on my Mac, with SD open in Screen 2, and run from SD, here is what I see:

  1. First window in on Screen 2, but at a relative 50,50 from the Screen Left,Top
    2020-05-11_19-38-09
    .
    • Here is what KM sees:

Left: 2610
Top: 50
Width: 404
Height: 227

  1. Next it Jumps to Screen 1, and at 50,50 from Left,Top
    • KM Sees:

Left: 50
Top: 50
Width: 404
Height: 250

  1. But then back to Screen 2, but NOT even in correct relative position:
    • KM Sees:

Left: 3630
Top: 339
Width: 420
Height: 154

If all of these are supposed to be on the same screen, then something is wrong.
By Shaneā€™s definition, ā€œmainScreenā€ for me would be Screen 2. I see no reason why it would every jump to Screen 1.

HTH.

That final window is a standard display dialog, nothing to do with Myriad Tables, so thereā€™s no control over where it appears.

Which screen contains your Dock?

On my system the menu activates on whatever screen the MT dialog will open in. What I donā€™t get is Iā€™m in script debugger, it runs the script. The MT dialog displays in SDā€™s window. On the next repeat the MT script displays in the other monitor. What is forcing it to change screens?

The point of the applescript display dialog was to see where it would appear and if it had any impact on where MT would appear.

Both. But it is hidden until I mouse over its region.
The screen that is active, that has a frontmost window that responds to keyboard, shows an enabled Apple menu at the top. The other screen shows a disabled menu (greyed-out).
In this case, SD7 was open in Screen 2, and showed the enabled menu.

That is exactly what I am seeing as well.

OK, I think I can see where itā€™s happening. The screen it appears on depends on whether you pass size values as well as x and y for initial position.

I have an updated version ā€” email me if you would like to test it.

Iā€™m noticing that display table with data doesnā€™t have an initial position parameter, but the result does have a final position record.

It would be nice to have both.

In an ideal world all parameters would be included in both display table with data and make new table with data, but unfortunately AppleScript only allows a limited number. Thatā€™s why modify table exists.

Is this new? In Myriad Tables Iā€™m noticing that when I display a table where the OK button is default itā€™s not highlighted. I believe it had always been highlighted before, and itā€™s been a little confusing.

It still responds to hitting the return key (but not the enter key).

Also, Iā€™ve hit a bit of stumbling block in doing a handler for Myriad tables.

The problem is for parameters like editable columns. If I set it to an empty list {} then nothing is editable. If I donā€™t pass a value, everything is editable. The problem is how do I set it up in a handler to be able to send a list of columns, and empty list or not set a value?

I tried setting it to missing value but that didnā€™t work.

Any suggestions?

I suppose I could do something like
repeat with x from 1 to the count of tableData...

and use that to build a list that includes every column, but that doesnā€™t seem very elegant.

Any way we could get missing value to work as if there the parameter wasnā€™t set?

It should be highlighted as long as the window is active.

Try it again. If you donā€™t pass a value, thatā€™s what the relevant variable contains.

Yup. I was just confused. I thought with missing value it would make all the columns editable. But thatā€™s {}. Missing value or no parameter make none of the columns editable.

Itā€™s very strange. Iā€™m sure it was highlighted previously, but not now. And the window is definitely active. Iā€™m entering text, hitting return and the button doesnā€™t highlight, but is active. If I hit return again it functions. Iā€™ve noticed this in two scripts, one an applet the other a menu script.

I can confirm itā€™s not. I have one script running thatā€™s called from an applet. It displays two MT windows, both with default buttons set, and then displays an AppleScript dialog. The default button on the appleScript dialog is highlighted but not on either of MT tables.

Same with a script run from a scripts menu. Default button is set, responds to ā€œreturnā€ but is not highlighted.

Does it matter what context the script is run in? In one case the app does a load script/run script. In the other itā€™s the Apple Scripts menu.

It could do. I canā€™t test here because Appleā€™s Scripts menu wonā€™t support Myriad Tables under Catalina. But it works fine from FastScripts.

It also happens when I run it from an applet using load script/run script.