Posts By: Gary Rosenzweig

4/11/23

A handy link hidden in macOS gives you quick access to the tech specs for your Mac model. You can also find out a lot with the handy and free Mactracker app.

4/8/23

iPadOS 16 was supposed to add the ability to use your Apple Pencil and Scribble to "draw" emoji. Or was it? Could be the feature is just something much simpler.

Type, Click and Use Menus In Shortcuts
4/7/23

Click a menu item

Application("TextEdit").activate();
var app = Application("System Events").processes["TextEdit"];
app.menuBars[0].menus.byName("File").menuItems[ "New" ].click();

Click a menu item in a submenu

Application("TextEdit").activate();
var app = Application("System Events").processes["TextEdit"];
app.menuBars[0].menus.byName("Edit").menuItems[ "Insert" ].menus[ "Insert" ].menuItems[ "Line Break" ].click();

Press a key

Application("System Events").keystroke('a')

Press a key with a modifier

Application("System Events").keystroke('a', { using: ['command down'] })

Press the left arrow key:

Application("System Events").keyCode(123)
// 124=right, 125=down, 126=up, 36=Return

Click General in System Settings

Application("System Settings").activate()
var app = Application("System Events").processes["System Settings"];
app.windows[0].groups[0].splitterGroups[0].groups[0].scrollAreas[0].outlines[0].rows[12].select()
// Note: General may not be the 12th item for you,
// you'll need to experiment

Print and then Click PDF in TextEdit:

Application("TextEdit").activate()
Application("System Events").keystroke('p', { using: ['command down'] })
Application("System Events").processes["TextEdit"].windows[0].sheets[0].splitterGroups[0].groups[1].buttons[0].click()
// Note: The PDF button may not be at this location
// depending on many factors

Script Editor JavaScript to help find user interface elements:

// Note this is JavaScript so make sure your
// Script Editor window is set to JavaScript
// NOT AppleScript

listObjects(Application("System Events").processes["System Settings"].windows(), "" )

function listObjects(uiObjects, indentStr) {
    for (var i in uiObjects) {
		if(uiObjects[i] instanceof Array) {
			listObjects(uiObjects[i], indentStr + '  ')
		} else if(uiObjects[i] instanceof Object){
			console.log('' + indentStr + i + ' Name:' + uiObjects[i].name() + ', Class:' + uiObjects[i].class() + ', Desc:' + uiObjects[i].description() + ', Value:' + uiObjects[i].value());
			listObjects(uiObjects[i].uiElements(), indentStr + '  ')
		}
	}
}
4/4/23

I no longer have an old-fashioned telephone landline. Yet, my old number and old phones still work the same way. And at a fraction of the cost. Anyone else doing this?

4/1/23

Apple has finally released their Classical Music app for Apple Music subscribers. It looks pretty much like the Music app, but with all other genres gone and things customized to how you would look for and play classical music instead.

3/27/23

I moved to a new office this week and the audio properties of this room are very different than my last. I'm working to reduce the reverb (echo) and while doing so, discovered that measuring reverb is both harder and easier than I thought.

3/24/23

Google Bard is their competitor to ChatGPT. Similar in many ways, one advantage to Bard is to knows what is going on in the world today, not 6 months ago.