Does app.command.GridSettings support ui = false?

I’m currently experimenting to see if it’s possible to script a grid setting for a specific size without using the GUI.

I would like to implement this using Does app.command.GridSettings, but I can’t get it to work.
Any hints would be appreciated.

Thanks in advance.

Hi @GangeSatoya,

Would you achieve your goal by setting a Sprite's gridBounds with a Rectangle?

Looks like app.command.showGrid() toggles the grid display on and off.



Hi @behreandtjeremy

With your advice, I was able to implement it successfully!

I’ve attached the code for those who have the same question.
This code will automatically display a 24x24 grid with no offset.

Thank you from the bottom of my heart!

-- Get the active sprite and assign it to the local variable <sprite>
local sprite = app.activeSprite 

-- Specify an arbitrary Rectangle and assign it to the local variable <gridSize>
local gridSize = Rectangle(0, 0, 24, 24)

-- Assign the value of the Rectangle variable to sprite.gridBounds
sprite.gridBounds = gridSize
1 Like