-
Notifications
You must be signed in to change notification settings - Fork 4
AutoHotkey collaboration #43
Copy link
Copy link
Open
Description
Thanks for the great solution.
I will share the AHK code that.
In the future, we plan to combine it with DEEPL's API to display it.
^F12:: ;Ctrl + F12 key
Critical, On
Clipboard := ""
Send, ^l
Sleep, 10
Send, ^c
Sleep, 50
ClipWait, 1
Haystack = "%Clipboard%"
Needle := ".pdf"
If InStr(Haystack, Needle)
{ ;This is a PDF
Process, Exist, python.exe ;Double activation prevention
If ErrorLevel<>0
{
Return
}
Else
{
Run, cmd.exe /c "\paper2html-master\paper2html\main.py", X:\temp\pdf_cashe, Min, ;Start if it is not launched,paper_cashe(ram disk set)
Sleep, 2000
Process_High("pdftoppm.exe/python.exe/cmd.exe/conhost.exe")
}
Run, http://localhost:5000/paper2html/convert?url=%Clipboard%
}
Else
{ ;Alert if not a PDF
MsgBox, 48, ,NOT PDF,
Return
}
SetTimer, close_python, -300000 ;idle Automatic end of server after 5 minutes
Return
close_python:
Process, Close, python.exe
SetTimer, close_python, off
Return
Process_High(Process_p1){
Loop,parse,Process_p1,/
{
Process,Exist,%A_LoopField%
if ( NewPID:=ErrorLevel )
Process,Priority,%NewPID%,High
}
Return
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels