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:
- First window in on Screen 2, but at a relative 50,50 from the Screen Left,Top
.- Here is what KM sees:
Left: 2610
Top: 50
Width: 404
Height: 227
- Next it Jumps to Screen 1, and at 50,50 from Left,Top
- KM Sees:
Left: 50
Top: 50
Width: 404
Height: 250
- 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.
It should be highlighted as long as the window is active.
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.
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.