-
Here's what I was testing
I also blindly tried the below Part 1 Script msgbox,, Clipboard contents at script start, % Clipboard ; blank
#NoEnv
#SingleInstance, force
SetBatchLines, -1
ListLines, off
msgbox,, Clipboard contents before Init, % Clipboard
LLInit()
msgbox,, Clipboard contents after Init, % Clipboard ; ends up blank
ClipSet("s",1,SendMethod,Clipboard) ; store current clipboard contents
ClearClipboard()
Clipboard := "Test"
msgbox,, Clipboard after directly setting Clip, % Clipboard ; shows Test
[[llpart1]]
msgbox,, Clipboard contents Clip after part1, % Clipboard ; shows Test
msgbox,, Clipboard contents llpart1 after part1, % llpart1 ; ends up blank still
SendKey(SendMethod, ShortcutPaste) ; paste changed clipboard using SendMethod defined by Lintalist settings
Clipboard:=ClipSet("g",1) ; restore original clipboard contents
msgbox,, Clipboard contents again, % Clipboard ; ends up blank still
ExitApp and msgbox,, Clipboard contents at script start, % Clipboard ; blank
#NoEnv
#SingleInstance, force
SetBatchLines, -1
ListLines, off
msgbox,, Clipboard contents before Init, % Clipboard
LLInit()
msgbox,, Clipboard contents after Init, % Clipboard ; ends up blank
ClipSet("s",1,SendMethod,Clipboard) ; store current clipboard contents
ClearClipboard()
msgbox,, Clipboard after clearing Clip, % Clipboard ; ends up blank
[[llpart1]]
msgbox,, Clipboard contents Clip after part1, % Clipboard ; ends up blank
msgbox,, Clipboard contents llpart1 after part1, % llpart1 ; ends up blank still
SendKey(SendMethod, ShortcutPaste) ; paste changed clipboard using SendMethod defined by Lintalist settings
Clipboard:=ClipSet("g",1) ; restore original clipboard contents
msgbox,, Clipboard contents again, % Clipboard ; ends up blank still
ExitApp |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for the feedback I can confirm your findings. This works just to confirm you can access the AutoHotkey clipboard variable in scripts: Part1: This is a Clipboard test Indeed when using Lines 896 to 904 in 0ad4909 If we move the processing above this check it should work. If (Text1 = "") and (Text2 = "") and (Script = "")
Return ; nothing to paste or run
If (InStr(Text1, "[[Clipboard]]") > 0) or (InStr(Text2, "[[Clipboard]]") > 0) ; if we do it here it saves us some time getting back the original clipsaved variable
{ ; insert clipboard
StringReplace, Text1, Text1, [[Clipboard]], %Clipboard%, All
StringReplace, Text2, Text2, [[Clipboard]], %Clipboard%, All
}
If (Script = "") or (ScriptPaused = 1) ; script is empty so we need to paste Text1 or Text2
{
If (PastText1 = 1) OR (Text2 = "")
Clip:=Text1 This will be included in the next update. Edit, experimental diff post If (Text1 = "") and (Text2 = "") and (Script = "")
Return ; nothing to paste or run
+If (InStr(Text1, "[[Clipboard]]") > 0) or (InStr(Text2, "[[Clipboard]]") > 0) ; if we do it here it saves us some time getting back the original clipsaved variable
+ { ; insert clipboard
+ StringReplace, Text1, Text1, [[Clipboard]], %Clipboard%, All
+ StringReplace, Text2, Text2, [[Clipboard]], %Clipboard%, All
+ }
If (Script = "") or (ScriptPaused = 1) ; script is empty so we need to paste Text1 or Text2
{
- If (InStr(Text1, "[[Clipboard]]") > 0) or (InStr(Text2, "[[Clipboard]]") > 0) ; if we do it here it saves us some time getting back the original clipsaved variable
- { ; insert clipboard
- StringReplace, Text1, Text1, [[Clipboard]], %Clipboard%, All
- StringReplace, Text2, Text2, [[Clipboard]], %Clipboard%, All
- }
If (PastText1 = 1) OR (Text2 = "")
Clip:=Text1
Else If (PastText1 = 0) ; if shift-enter use Text2 BUT if it is empty revert to Text1 |
Beta Was this translation helpful? Give feedback.
Thanks for the feedback I can confirm your findings.
This works just to confirm you can access the AutoHotkey clipboard variable in scripts:
Part1: This is a Clipboard test
Script: MsgBox,, Clipboard contents at script start, % Clipboard
Indeed when using
[[clipboard]]
there is a logic error - It checks if it should process the[[clipboard]]
, but only does so when scripts aren't present or deactivated here:lintalist/lintalist.ahk
Lines 896 to 904 in 0ad4909