Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not run by AppleScript #38

Open
Lawrence-of-AnKing opened this issue Nov 13, 2024 · 3 comments
Open

Can not run by AppleScript #38

Lawrence-of-AnKing opened this issue Nov 13, 2024 · 3 comments

Comments

@Lawrence-of-AnKing
Copy link

When running the command sudo /Applications/kanata/kanata-tray-macos in the terminal, everything works fine. However, when using AppleScript to run it, it prompts kanata crashed, and kanata fails to run. Even clicking restart has no effect.

My applescript blow:

set kanataScript to "/Applications/kanata/kanata-tray-macos"

do shell script kanataScript with administrator privileges

The reason for doing this is that I want to use Raycast to launch kanata-tray.

@rszyma
Copy link
Owner

rszyma commented Nov 13, 2024

It's hard to guess what goes wrong as I've never used macOS. Is there any crash log?

@Lawrence-of-AnKing
Copy link
Author

It's hard to guess what goes wrong as I've never used macOS. Is there any crash log?

As u see, no log in /tmp:

截屏2024-11-14 09 09 19

The Raycast showed output:

loaded config: &config.Config{
    PresetDefaults: config.Preset{
        Autorun:          false,
        KanataExecutable: "/Applications/kanata/bin/kanata",
        KanataConfig:     "/Applications/kanata/config/basic.kbd",
        TcpPort:          5831,
        LayerIcons:       {"hyper_key_layer":"kanata-T.ico", "space_layer":"kanata-S.ico", "sspace_layer":"kanata-H.ico", "start":"kanata-icon.ico", "super_key_layer":"kanata-C.ico"},
        Hooks:            config.Hooks{
            PreStart: {
            },
            PostStart: {
            },
            PostStartAsync: {
            },
            PostStop: {
            },
        },
    },
    General: config.GeneralConfigOptions{},
    Presets: {
        "basic": &config.Preset{
          Autorun:          true,
          KanataExecutable: "/Applications/kanata/bin/kanata",
          KanataConfig:     "/Applications/kanata/config/basic.kbd",
          TcpPort:          5831,
          LayerIcons:       map[string]string{},
          Hooks:            config.Hooks{
            PreStart:       [][]string{},
            PostStart:      [][]string{},
            PostStartAsync: [][]string{},
            PostStop:       [][]string{},
          },
        }
        "test": &config.Preset{
          Autorun:          false,
          KanataExecutable: "/Applications/kanata/bin/kanata",
          KanataConfig:     ".config/test.kbd",
          TcpPort:          5831,
          LayerIcons:       map[string]string{},
          Hooks:            config.Hooks{
            PreStart:       [][]string{},
            PostStart:      [][]string{},
            PostStartAsync: [][]string{},
            PostStop:       [][]string{},
          },
        }
    },
}

@rszyma
Copy link
Owner

rszyma commented Nov 14, 2024

It's not a full log, obviously. You're running old version, so get latest one first. In the latest version there's "Show Log" button between "Configure" and "Exit tray" buttons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants