Skip to content

Conversation

@sapphi-red
Copy link
Member

Description

Converted openchrome.applescript to JXA so that it's easier to maintain.
It seems this also fixed #15880.

@sapphi-red sapphi-red added the p1-chore Doesn't change code behavior (priority) label Jul 18, 2025
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works great! I can't highlight it, but some variables with the "AppleScript" name can probably be renamed to JXA too.

Also FWIW, I realized you need to enable this (Google Chrome) for the script to work, even with the applescript before:

Image

Otherwise you get these errors:

  • AppleScript:
openChrome.applescript:610:628: execution error: Not authorised to send Apple events to Google Chrome. (-1743)

    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at ChildProcess.exithandler (node:child_process:414:12)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)
  • JXA (a little cryptic):
openChrome.js: execution error: Error: Error: An error occurred. (-1743)

    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at ChildProcess.exithandler (node:child_process:414:12)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

@sapphi-red sapphi-red merged commit 7979f9d into main Jul 28, 2025
18 checks passed
@sapphi-red sapphi-red deleted the refactor/rewrite-openchrome-applescript-to-jxa branch July 28, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p1-chore Doesn't change code behavior (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--open with multiple Chrome window can focus the wrong window

4 participants