question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSX bundle id collides with base electron app, making basic applescript automations open the Electron starter app.

See original GitHub issue

Attempting to automate windows with applescript causes the base electron app on the system to run, making it difficult to make VSCode an active window. VSCode shares a bundle ID with the base electron app “com.github.electron”, which causes OSX System Events to be confused with which app to activate.

  • VSCode Version: 1.21.1
  • OS Version: High Sierra 10.13.3

Steps to Reproduce:

  1. Have a project with electron in its node_modules somewhere on your system.
  2. Start VSCode
  3. Run this applescript which gets processes, and checks for windows. The variable appa gets set to the bundle ID “Electron” which confuses OSX.


on getWindows(appa)
	tell application appa
		set idList to null
		set nameList to null
		try
			set idList to the id of every window
		end try
		try
			set nameList to the name of every window
		end try
	end tell
	return idList & nameList
end getWindows

tell application "System Events"
	set openApps to {name, unix id, title} of (processes where background only is false)
end tell

set processList to item 1 of openApps
repeat with i from 1 to length of item 1 of openApps
	set item i of processList to {|name|:item i of processList, title:item i of item 3 of openApps, pid:item i of item 2 of openApps, |windows|:getWindows(item i of processList), id:id of application (item i of processList)}
end repeat
processList

Does this issue occur when all extensions are disabled?: Yes

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
joaomorenocommented, Apr 3, 2018

Got it, we can change that.

0reactions
joaomorenocommented, Jul 18, 2018

Unfortunately I’m going to have to close this as I can’t get a successful update flow working with Squirrel after renaming the executable. I do want this fixed, but not at the cost of breaking the updates for every macOS user. It’s too late. 😢

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac Automation Scripting Guide: Automating the User Interface
In System Events, the process class represents a running app. Listing 37-1 shows how to target an app using this class. APPLESCRIPT. Open...
Read more >
Mac App Store Submission Guide - Electron
Mac App Store Submission Guide. This guide provides information on: How to sign Electron apps on macOS;; How to submit Electron apps to...
Read more >
Need to ask for AppleScript permissions in an electron app
All I am using these permissions for are to get URL's so if there is a simpler way to do that I am...
Read more >
Mac problem-solving - The Eclectic Light Company
For older articles about previous versions of OS X, see this article. For basic help with managing problems, see my Mac Troubleshooting Summary....
Read more >
Script to open url in browser - Caritas Castellaneta
Mac : Command + Shift + C. start https://stackoverflow. ... If you hate using Electron-based applications, perhaps you can still read about Min...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found