Skip to content

Commit af8ec84

Browse files
v1.1: Implement Pro setting and prompt Prefix/Suffix
1 parent 024f33a commit af8ec84

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

AI-Hotkeys-de.ini

56 Bytes
Binary file not shown.

AI-Hotkeys.ahk

+29-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;;;;;;;;;;;;;;;;;;
2-
; AI-Hotkeys.ahk ; Version 1.0.0.20240901 - Copyright (C) 2024 Wolfram Ravenwolf
2+
; AI-Hotkeys.ahk ; Version 1.1.0.20240922 - Copyright (C) 2024 Wolfram Ravenwolf
33
;;;;;;;;;;;;;;;;;;
44

55
; This program is free software: you can redistribute it and/or modify
@@ -55,6 +55,8 @@ global REJECT1 := "Compose a negative response/rejection to the following text"
5555
global REJECT2 := "Answer in my name. Maintain the language and level of formality. Write only the rejection, nothing else. KEEP THE ORIGINAL LANGUAGE OF THE TEXT (E.G. ENGLISH OR GERMAN)!"
5656
global ACCEPT1 := "Compose an affirmative response/acceptance to the following text"
5757
global ACCEPT2 := "Answer in my name. Maintain the language and level of formality. Write only the acceptance, nothing else. KEEP THE ORIGINAL LANGUAGE OF THE TEXT (E.G. ENGLISH OR GERMAN)!"
58+
global PREFIX := ""
59+
global SUFFIX := ""
5860

5961
; ------------------------------------------------------------------------------
6062
; Default (English) URLs
@@ -105,6 +107,8 @@ global REJECT1 := "Verfasse eine verneinende/ablehnende Antwort/Absage auf folge
105107
global REJECT2 := "Antworte in meinem Namen. Behalte Sprache und Formalitätsgrad bei. Schreibe nur die Absage, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
106108
global ACCEPT1 := "Verfasse eine bejahende/zustimmende Antwort/Zusage auf folgenden Text"
107109
global ACCEPT2 := "Antworte in meinem Namen. Behalte Sprache und Formalitätsgrad bei. Schreibe nur die Zusage, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
110+
global PREFIX := ""
111+
global SUFFIX := ""
108112

109113
; ------------------------------------------------------------------------------
110114
; Default (German) URLs
@@ -131,6 +135,7 @@ global URL_WIKIPEDIA_SEARCH := "https://de.wikipedia.org/w/index.php?search="
131135
global CapsLockHotkeys := true
132136
global WinHotkeys := true
133137
global ClipboardEditor := true
138+
global Pro := true
134139

135140
; ------------------------------------------------------------------------------
136141
; Load custom variables if an INI file exists in My Documents or in Script Dir
@@ -217,7 +222,10 @@ LoadCustomVariables() {
217222
{
218223
key := parts1
219224
value := parts2
220-
%key% := value
225+
if (value = "0" || value = "false")
226+
%key% := false
227+
else
228+
%key% := value
221229
}
222230
}
223231
}
@@ -274,22 +282,35 @@ AI(Task := "", WritingInstructions := "")
274282

275283
if (Clipboard)
276284
{
285+
prompt := ""
286+
287+
if (PREFIX != "")
288+
prompt .= PREFIX . "`n`n"
289+
277290
if (Task)
278291
{
279-
prompt := Task . ":`n`n"
292+
prompt .= Task . ":`n`n"
280293
if (WritingInstructions)
281294
prompt .= "<text>`n"
282295
prompt .= Clipboard
283296
if (WritingInstructions)
284297
prompt .= "`n</text>`n`n" . WritingInstructions
285298
}
286299
else
287-
prompt := Clipboard
300+
prompt .= Clipboard
301+
302+
if (SUFFIX != "")
303+
prompt .= "`n`n" . SUFFIX
288304

289305
url .= "search?"
306+
290307
if (WritingInstructions)
291308
url .= "focus=writing&"
292-
url .= "pro=true&q=" . UrlEncode(prompt)
309+
310+
if (Pro = "1" || Pro = "true" || (Pro = "auto" && WritingInstructions = ""))
311+
url .= "pro=true&"
312+
313+
url .= "q=" . UrlEncode(prompt)
293314
}
294315

295316
Clipboard := ClipboardOld
@@ -352,7 +373,7 @@ Search(Engine)
352373
; CapsLock Hotkeys
353374
; ==============================================================================
354375

355-
#If (CapsLockHotkeys && CapsLockHotkeys != "false")
376+
#If (CapsLockHotkeys)
356377

357378
; ----------------------------------------------------------------------------------------------------
358379
; CapsLock Behavior
@@ -426,7 +447,7 @@ SC03A & z::AI(ACCEPT1, ACCEPT2)
426447
; Win Hotkeys
427448
; ==============================================================================
428449

429-
#If (WinHotkeys && WinHotkeys != "false")
450+
#If (WinHotkeys)
430451

431452
; ------------------------------------------------------------------------------
432453
; Perplexity
@@ -465,7 +486,7 @@ SC03A & z::AI(ACCEPT1, ACCEPT2)
465486
; Clipboard Editor
466487
; ==============================================================================
467488

468-
#If (ClipboardEditor && ClipboardEditor != "false")
489+
#If (ClipboardEditor)
469490

470491
; ------------------------------------------------------------------------------
471492
; Alt+LWin / Win+LAlt = Clipboard Editor

AI-Hotkeys.ini

56 Bytes
Binary file not shown.

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@ To make changes, simply copy the file to your Documents folder and edit it there
207207
208208
For German-speaking users, a localized version called `AI-Hotkeys-de.ini` is also available. On German Windows systems, this file will be automatically loaded when placed in your Documents folder or in the same directory as the executable.
209209
210+
### Pro Setting
211+
212+
The `Pro` setting in the INI file controls how the app interacts with Perplexity's Pro features:
213+
214+
- `Pro=true` (default): Always uses Pro search for all queries.
215+
- `Pro=auto`: Automatically determines whether to use Pro search based on the task, helping to conserve Pro searches for non-subscribers.
216+
- `Pro=false`: Never uses Pro search, suitable for non-subscribers or those who want to avoid using Pro searches automatically.
217+
218+
This setting is particularly useful for non-Pro subscribers who want to limit their Pro search usage. You can adjust this in the `[Settings]` section of your INI file:
219+
220+
```ini
221+
[Settings]
222+
Pro=auto ; or true/false
223+
```
224+
210225
## A Personal Note
211226

212227
Since developing **AI-Hotkeys**, I've been using it extensively in my daily workflow and have found it to be an incredibly valuable tool. I'm sharing it with you all in the hope that it might prove as beneficial to you as it has been to me.

0 commit comments

Comments
 (0)