AnkiRestart🔂[Support Thread]

[ AnkiWeb page ]

banner_AnkiRestart


This add-on just adds a reboot button to the menu bar. (Prototype)

[ Description ]

  • Skip sync and restart quickly.
  • When closed normally, it will be synced.
  • Restart Anki in Safe Mode (Without Add-ons)
  • Auto Restart After SafeMode.
  • Console Mode(Windows)
  • For Mac, the button is shown on the right.

image

[ Warning ]

  • This add-on is separated from Anki in purpose of restarting Anki, so there is a high possibility of mis-detection by antivirus software. This problem is solvable, but requires $200+ per year (Code Signing), so I’m not considering it at now.

  • [ Windwos ] If your antivirus software
    mis-detects add-on, the “.exe” will be quarantined. It’s labeled Trojan but it’s a mis-detection, so no danger. In this case, this add-on cannot be used without Allow on device.

  • [ Mac ] If you do not grant permissions, it is likely that you will not be able to launch the “.app”. I’m not certain if it will work on the latest Macs.

[ Others ]

If you have any bugs or questions, please feel free to comment.


[ AnkiWeb page ]

11 Likes

Nice job!

1 Like

Can you add this too?
Option for auto restart after updating addons - Suggestions - Anki Forums (ankiweb.net)

1 Like

I added the feature to auto-restart Anki after updating the add-ons. Cross-platform debugging and other add-on features are not yet complete, so it will be a while before I release it on AnkiWeb, but you can download the add-on under development for free from my Patreon page (no registration required). It has been tested only on windows, Anki 2.1.66 (Qt6).

1 Like

再起動用のショートカットを追加して頂くことって可能ですか?
(Ctrl + RやF5など)

1 Like

たぶん可能ですね、後でちょっと調べてみます。

2 Likes

ありがとうございます!

can you add support for running anki in portable mode ? (-b run argument)

it currently ignores run arguments and just restarts in normal mode with a completely different profile

It may be possible, I will look into this as well.

2 Likes

再起動用のショートカットキーの機能を追加しました。
初期設定は"Ctrl+Shift+R"です。
設定ウィンドウのオプションタブから好きなキーに変更できます。

[ AnkiWeb ] AnkiRestart🔂 Quick Aniki Rebooter, for Anki Customize and Develop by Shige

1 Like

遅くまでありがとうございます。
早速使わせていただきます!

1 Like

I added the option to specify the database for Anki.
Select the Use custom base foloder(-b) checkbox and specify the path to the database, it should work.

  • Please note that " " is not allowed in the path.
    For example,
    :x: "G:\Ankiˉanki.exe"
    :o: G:\Anki\anki.exe

  • And the -b argument is already setup, so there is no need to fill it in.

  • Perhaps Use Anki path manually does not need to be used.

  • For now, there is no function to add other arguments.

2 Likes

The function to restart after updating add-ons has been added to the default for the add-on,
but it does not work when updating add-ons on Anki startup.(Perhaps it works only when manually updating from the add-ons dialog.)
If restarting in the middle of the process, the process will be interrupted, so this feature is still under development.

2 Likes

Thanks!

1 Like

Cool add-on and really awesome presentation, @Shigeyuki ! :trophy:

I use the following AutoHotkey (v2) script to quickly restart Anki by pressing Win+N when Anki’s main window is active. When I press Control+Win+N the script also toggles night mode on or off before restarting. (For languages other than German the script would have to be modified slightly for this to work.)

#SingleInstance Force
#Requires AutoHotkey v2.0-

#HotIf WinActive("ahk_exe anki.exe")

#HotIf WinActive("- Anki")

#N:: ; Restart Anki with the same profile by pressing Win+N when the Anki-window is active.
{
profile := RegExReplace(WinGetTitle("A"), " - Anki$")
path := WinGetProcessPath("A")
Send "!{F4}"
ProcessWaitClose("anki.exe")
Run path ' -p "' profile '"'
}

^#N:: ; Restart Anki with the same profile by pressing Win+N when the Anki-window is active - but also toggle nightmode
{
profile := RegExReplace(WinGetTitle("A"), " - Anki$")
path := WinGetProcessPath("A")
Send "^p"
WinWaitActive("Einstellungen")
MouseClick("Left", 47, 74)
Send "{Tab 7}{Space}{Esc}"
WinWaitActive("Anki")
Send "{Enter}"
WinWaitActive(profile)
Send "!{F4}"
ProcessWaitClose("anki.exe")
Run path ' -p "' profile '"'
}

#HotIf

#HotIf
1 Like

The addon seems to be turning off the option to automatically sync on profile open/close

  • The purpose of this add-on is to quickly restart anki, so it is intentionally turned off.

  • After the restart, the option is restored, but occasionally there is a problem with the sync option still being OFF.

Is there a way to fix that or turn off the option for it to turn off this option?

I don’t mind if it syncs before it closes

There is no such option at the moment, so I will add it later.

1 Like

I added an option to turn on/off disable auto sync.

  • AnkiRestart Settings → option tab → Disable suto sync when restarting