Keynote is a wonderful application to make Command Icons.
This script will make template in Keynote in size 256x256, and could be used for ex. Touch Portal.
You maybe wonder why I make A1 Cell of table, I use the background color of cell if I need to
make a shape that is black. (Keynote use black color for no fill)
The second script will export every slide in the document to Desktop as PNG
I’m sure this scripts could be better, but for now it works on my Mojave.
The Script use GUI scripting in 2 places and English.
EDIT: If Keynote is not open it will open and make the template, make your icons, run second script.
Some example done.
https://filebin.net/ogfsugmg2xjzb82z
-- Size of the document
-- This settings are for document and table and should be the same.
set {dHeight, dWidth, tHeight, tWidth} to {256, 256, 256, 256}
tell application id "com.apple.iWork.Keynote"
set newDocument to make new document with properties {height:dHeight, width:dWidth}
tell front document to set the base slide of current slide to master slide "Blank"
set thisSlide to current slide of front document
tell thisSlide
set {title showing, body showing} to {false, false}
end tell
end tell
--~~~~~~~~~~~
-- Set Background color of the slide Layout to 'No Fill'
tell application "System Events" to tell application process "Keynote"
set frontmost to true
tell window 1 to tell scroll area 1 to tell pop up button 1
click
tell menu 1
click menu item "No Fill"
end tell
end tell
end tell
--~~~~~~~~~~~
delay 0.1
tell application id "com.apple.iWork.Keynote"
set thisTable to current slide of front document
tell thisTable
make new table
end tell
-- Set properties for table
tell table 1 of current slide of front document
set {header column count, header row count, footer row count} to {0, 0, 0}
set position to {0, 0}
set {height, width} to {tHeight, tWidth}
set column count to 1
set row count to 1
end tell
--~~~~~~~~~~~
delay 0.1
tell application "System Events" to tell application process "Keynote"
set frontmost to true
tell window 1 to tell radio group 1 to click radio button "Table"
delay 0.1
tell window 1 to tell scroll area 1 to tell pop up button 4
click
tell menu 1
click menu item "None"
end tell
end tell
end tell
--~~~~~~~~~~~
end tell
=====>
-- Keynote Slides to be Export as PNG
tell application id "com.apple.iWork.Keynote"
set thisSlide to current slide of front document
tell table 1 of thisSlide
-- get its properties
-- Clear the value of the cell, before we export.
set the rangeStart to the name of cell 1 of column 1
set the rangeEnd to the name of last cell of last column
tell range (rangeStart & ":" & rangeEnd) to clear
end tell
set exportPath to POSIX path of (path to desktop) & "IconSlides"
-- Export every slide to PNG format
export front document to exportPath as slide images with properties {image format:PNG, export style:IndividualSlides}
end tell