1. The clipboard pop up menu is now semi-transparent (you can change it on line 405. 0 for opaque and 255 fully transparent, now at 210).
2. There are two styles of this menu, the existing one and a new one more in line with the colors I'm using in the utility (yellow and blue).
You can switch from one style to another in the "Basic Clipboard" submenu.
(The styles section is duplicated in the script because it has to be at the top for it to start, but you can't refer to the top of the script, when switching, via on gosub because the Tray menu creates problems).
Code: Select all
;https://www.autohotkey.com/boards/viewtopic.php?f=76&t=92963
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory
;EnvSet, SD, %A_ScriptDir%
#Include Library\WinClipAPI.ahk
#Include Library\WinClip.ahk
#Include Library\ViewHtml.ahk
#Include Library\Gdip_All_1.45.ahk
#Include Library\PUM_API.ahk
#Include Library\PUM.ahk
;#Include Library\ToolTipEx.ahk
#SingleInstance, Force
#InstallMousehook
#Persistent
DetectHiddenWindows, On
CoordMode, Mouse, Screen
SetBatchLines, -1
Name := "Clipboard Utility - "
Version := "4.3c"
StartTicks:=A_TickCount
ClipBoardHistory:=Object()
ClipBoardEnabled=1
previousClip=%clipboard%
NotifyClip := 1
CorpusCount := 0
DirectoryCount := 0
Iniciate := 0
PDFCount := 0
WordCount := 0
SuspendThumbnail := 0
SuspendHotkeys := 1
Style := 1
if !FileExist(HTMLTemp)
{
FileCreateDir, HTMLTemp
}
if !FileExist(TempClip)
{
FileCreateDir, TempClip
}
;Hotkey, LButton Up, off
;loop, HTMLTemp\Corpus*.html
;CorpusCount := % Floor(A_Index)
if FileExist("TempClip\Clip1.clip")
{
Loop, TempClip\Clip*.clip
NumberClip := A_Index
;MsgBox, %NumberClip%
Loop, %NumberClip%
{
ReadClip:= "TempClip\Clip" A_Index ".clip"
FileRead, ClipHsy, %ReadClip%
FileDelete, %ReadClip%
ClipSave(ClipBoardHistory, ClipHsy, A_Index)
}
}
;***************************************************************************************************************************
If Style=0
{
; parameters of the PUM object, the manager of the menus
pumParams := { "SelMethod" : "fill" ;item selection method, may be frame,fill
,"selTColor" : 0xFFFFFF ;selection text color
,"selBGColor" : 0x036FC5 ;selection background color, -1 means invert current color
,"oninit" : "PUM_out" ;function which will be called when any of this events happen, se it below
,"onuninit" : "PUM_out"
,"onselect" : "PUM_out"
,"onrbutton" : "PUM_out"
,"onmbutton" : "PUM_out"
,"onrun" : "PUM_out" }
;PUM_Menu parameters
menuParams1 := { "bgcolor" : 0xFFFFF4 ;background color of the menu R
, "iconssize" : 0 ;size of icons in the menu
, "tcolor" : 0x064D85} ; text color of the menu items 036FC5 1A86DB 054C84 064D85 02192C 043053
}
If Style=1
{
pumParams := { "SelMethod" : "fill" ;item selection method, may be frame,fill
,"selTColor" : 0x363E69 ;selection text color 0x02192C 0xFFFFFF
,"selBGColor" : 0xFFFFA9 ;selection background color, -1 means invert current color 0x036FC5
,"oninit" : "PUM_out" ;function which will be called when any of this events happen, se it below
,"onuninit" : "PUM_out"
,"onselect" : "PUM_out"
,"onrbutton" : "PUM_out"
,"onmbutton" : "PUM_out"
,"onrun" : "PUM_out" }
;PUM_Menu parameters
menuParams1 := { "bgcolor" : 0x363E69 ;background color of the menu R
, "iconssize" : 32 ;size of icons in the menu
, "tcolor" : 0xFFFF33} ; text color of the menu items 036FC5 1A86DB 054C84 064D85 02192C 043053
}
;create an instance of PUM object, it is best to have only one of such in the program
pm := new PUM( pumParams )
;***************************************************************************************************************************
Menu, Tray, Icon, Resources\Scissors_Green.ico
Menu, Tray, NoStandard
Menu, tray, Add, %name% %version%, Nothing
Menu, tray, Icon, %name% %version%, Resources\Clipboard Utility.ico
Menu, Tray, Add
Menu, tray, Add, Exit , Exit
Menu, tray, Icon, Exit , shell32.dll, 132
Menu, Tray, Add
Menu, tray, Add, &Suspend Clipboard Utility , Stanby
Menu, tray, Icon,&Suspend Clipboard Utility , %A_ScriptDir%\Resources\Scissors_Red.ico
Menu, Tray, Add, Keep Only Hotkeys Necessary, SuspendHotkeys
Menu, Tray, Icon, Keep Only Hotkeys Necessary, Resources\No_Hotkeys.ico
Menu, Tray, Add
Menu, Tray, Add, Help, HelpButton
Menu, Tray, Icon, Help, %A_ScriptDir%\Resources\Help.ico
Menu, Tray, Add
Menu Tray, Add, Open Info, Tray_Open
Menu Tray, Icon, Open Info, %A_ScriptDir%\Resources\Info.ico
Menu, tray, Add, &Reload this Script , Reloaded
Menu, tray, Icon,&Reload this Script , %A_ScriptDir%\Resources\2488.ico
Menu, tray, Add, &Edit this Script , EditScript
Menu, tray, Icon,&Edit this Script , comres.dll, 7
Menu, tray, Add
Menu, winmanagetID, Add, Clipboard Window Extended, RButtonAlt
Menu, winmanagetID, icon, Clipboard Window Extended, %A_ScriptDir%\Resources\162.ico
Menu, winmanagetID, Add, Clipboard Window Reduced, ReducedAlt
Menu, winmanagetID, icon, Clipboard Window Reduced, %A_ScriptDir%\Resources\Clipboard Utility.ico
Menu, winmanagetID, Add, Utility Window, WUtil
Menu, winmanagetID, icon, Utility Window, %A_ScriptDir%\Resources\75a.ico
Menu, winmanagetID, Add, Copy Clipboard Window, CopyGui
Menu, winmanagetID, icon, Copy Clipboard Window, Resources\Clipboard Utility 5.ico
Menu, Tray, add, Window Management, :winmanagetID
Menu, tray, Icon, Window Management, %A_ScriptDir%\Resources\2036.ico
Menu, BasicClipID, Add, Disable Basic Clipboard, SuspendBasicClip
Menu, BasicClipID, Icon, Disable Basic Clipboard, Resources\Clipboard Utility 4.ico
Menu, BasicClipID, Add, Deactivate Notifications in Tray, SuspendNotifClip
Menu, BasicClipID, Icon, Deactivate Notifications in Tray, Resources\No_Sound.ico
Menu, BasicClipID, Add, Delete all Basic Clipboard, DeleteBasic
Menu, BasicClipID, Icon, Delete all Basic Clipboard, Resources\Recycle 2.ico
Menu, BasicClipID, Add
Menu, BasicClipID, Add, Switch to Simple Style, SwitchStyle
Menu, BasicClipID, Icon, Switch to Simple Style, Resources\1005.ico
Menu, Tray, Add, Basic Clipboard, :BasicClipID
Menu, Tray, Icon, Basic Clipboard, Resources\Clipboard-Blue.ico
Menu, tray, Add
Menu, Tray, Add, Save all Clipboard to PDF File, SavePDF
Menu, Tray, Icon, Save all Clipboard to PDF File, %A_ScriptDir%\Resources\PDF.ico
Menu, Tray, Add, Save all Clipboard to Word File, SaveWord
Menu, Tray, Icon, Save all Clipboard to Word File, %A_ScriptDir%\Resources\Word1.ico
Menu, Tray, Add, Extract URL's from Clipboard, URLButton
Menu, Tray, Icon, Extract URL's from Clipboard, %A_ScriptDir%\Resources\URL.ico
Menu, ThumbnailID, Add, Postpone Thumbnail Creation, SuspendThumbnail
Menu, ThumbnailID, Icon, Postpone Thumbnail Creation, %A_ScriptDir%\Resources\1908.ico
Menu, ThumbnailID, Add, Create Missing Thumbnails, CreateMissing
Menu, ThumbnailID, Icon, Create Missing Thumbnails, %A_ScriptDir%\Resources\949.ico
Menu, Tray, Add, Thumbnail Creation, :ThumbnailID
Menu, Tray, Icon, Thumbnail Creation, %A_ScriptDir%\Resources\989.ico
Menu, DeleteID, Add, Delete Last Clipboard, DeleteLast
Menu, DeleteID, Icon, Delete Last Clipboard, %A_ScriptDir%\Resources\1892.ico
Menu, DeleteID, Add, Delete All Clipboard, DeleteAll
Menu, DeleteID, Icon, Delete All Clipboard, %A_ScriptDir%\Resources\Recycle Bin Full.ico
Menu, Tray, add, Delete Options, :DeleteID
Menu, tray, Icon, Delete Options, %A_ScriptDir%\Resources\Recycle 3.ico
Menu, Tray, add
;**********************************************************************************************
ReloadSession:
Loop, %A_ScriptDir%\HTMLTemp*, 2, 0
SessionTotal := A_Index-1
FileDelete, SessionNumber.txt
;If !CorpusCount=0
;{
NumberSessTemp := "HTMLTemp\Session.txt"
FileRead, Session1, %NumberSessTemp%
; Fileappend, %Session1% `n, SessionNumber.txt
;Menu, SessionID, add, %Session1%, LabelSessionAct1
;Menu, SessionID, Icon, 0: %Session1%, %A_ScriptDir%\Resources\2293.ico
;Menu, SessionID, add
Menu, SessionID, add, Create New Session, NewSession
Menu, SessionID, Icon, Create New Session, %A_ScriptDir%\Resources\178.ico
Menu, SessionID, add, Delete Empty Sessions, DeleteSessions
Menu, SessionID, Icon, Delete Empty Sessions, %A_ScriptDir%\Resources\Recycle 2.ico
Menu, SessionID, add
Menu, SessionID, add, 0: %Session1%, LabelSessionAct1
Menu, SessionID, Icon, 0: %Session1%, %A_ScriptDir%\Resources\2478.ico
;Menu, SessionID, add, Current Session, LabelSessionAct0
;Menu, SessionID, Icon, Current Session, %A_ScriptDir%\Resources\2478.ico
;************************************************************************
loop, %SessionTotal%
{
FileDelete, SessionCount.txt
FileAppend, %A_ScriptDir%, SessionCount.txt
FullFile:="\HTMLTemp" A_Index "\*.*"
FileAppend, %FullFile%, SessionCount.txt
FileRead, CountFiles, SessionCount.txt
loop, %CountFiles%
FilesCount := % Floor(A_Index/6)
;If FilesCount="" FilesCount=0
NameTemp := ScriptDir "HTMLTemp" A_Index "\Session.txt"
FileRead, Session1, %NameTemp%
Fileappend, %Session1% — %FilesCount% Clipboards`n, SessionNumber.txt
}
Loop, read, SessionNumber.txt
{
Menu, SessionID, add, %A_Index%: %A_LoopReadLine%, LabelSession
}
Menu, Tray, add, Clipboard Sessions, :SessionID
Menu, Tray, Icon, Clipboard Sessions, %A_ScriptDir%\Resources\2036.ico
;**********************************************************************
ReloadMenu:
loop, HTMLTemp\Corpus*.html
CorpusCount := % Floor(A_Index)
FileDelete, SesionName.txt
If !CorpusCount=0
{
Loop, %CorpusCount%
{
NameTemp := "HTMLTemp\Name" A_Index ".txt"
FileRead, Name1, %NameTemp%
FileAppend, %Name1%`n, SesionName.txt
}
Loop, read, SesionName.txt
{
Menu, ClipboardID, add, %A_Index%: %A_LoopReadLine%, ButtonLabelTray
}
Menu, Tray, add, Clipboard, :ClipboardID
Menu, Tray, Icon, Clipboard, C:\Windows\system32\shell32.dll,261
}
Menu, Tray, Default, Basic Clipboard
;Menu, Tray, Default, Window Management
;Menu, Tray, Tip, Clipboard Utility 4.1f
Menu, Tray, Tip, This Session has 0%CorpusCount% Clipboards
Style:
If Style=0
{
; parameters of the PUM object, the manager of the menus
pumParams := { "SelMethod" : "fill" ;item selection method, may be frame,fill
,"selTColor" : 0xFFFFFF ;selection text color
,"selBGColor" : 0x036FC5 ;selection background color, -1 means invert current color
,"oninit" : "PUM_out" ;function which will be called when any of this events happen, se it below
,"onuninit" : "PUM_out"
,"onselect" : "PUM_out"
,"onrbutton" : "PUM_out"
,"onmbutton" : "PUM_out"
,"onrun" : "PUM_out" }
;PUM_Menu parameters
menuParams1 := { "bgcolor" : 0xFFFFF4 ;background color of the menu R
, "iconssize" : 0 ;size of icons in the menu
, "tcolor" : 0x064D85} ; text color of the menu items 036FC5 1A86DB 054C84 064D85 02192C 043053
}
If Style=1
{
pumParams := { "SelMethod" : "fill" ;item selection method, may be frame,fill
,"selTColor" : 0x363E69 ;selection text color 0x02192C 0xFFFFFF
,"selBGColor" : 0xFFFFA9 ;selection background color, -1 means invert current color 0x036FC5
,"oninit" : "PUM_out" ;function which will be called when any of this events happen, se it below
,"onuninit" : "PUM_out"
,"onselect" : "PUM_out"
,"onrbutton" : "PUM_out"
,"onmbutton" : "PUM_out"
,"onrun" : "PUM_out" }
;PUM_Menu parameters
menuParams1 := { "bgcolor" : 0x363E69 ;background color of the menu R
, "iconssize" : 32 ;size of icons in the menu
, "tcolor" : 0xFFFF33} ; text color of the menu items 036FC5 1A86DB 054C84 064D85 02192C 043053
}
;create an instance of PUM object, it is best to have only one of such in the program
pm := new PUM( pumParams )
; Menu2
Gui, CopyButtom: new
Gui, CopyButtom: -Caption +Owner
Gui, CopyButtom:Color, ffffd6
Gui, CopyButtom:Margin, 12, 12
;Gui, CopyButtom:+Owner
Gui, CopyButtom:Add, Button, x1 y1 w64 h15 gExitCopy, Exit
Gui, CopyButtom:Add, Button, x1 y17 w64 h65 hwndIcon gCopyTexClip
Gui, CopyButtom:Add, Picture, x66 y0 w12 h81 E0x200 vState0 icon1 gSubRoutine1, Resources\PauseOn.png
Gui, CopyButtom:Add, Picture, x66 y0 w14 h83 Border vState1 icon1 gSubRoutine1, Resources\PauseOff.png
GuiButtonIcon(Icon, "Resources\Clipboard Utility 5.ico", 1, "s90")
/*
if FileExist("HTMLTemp\Text1.html")
MsgBox, 0x1034,, There are clipboards from a previous session `n`n Do you want to delete them?
IfMsgBox Yes
Gosub, Borrado
Else
*/
GoSub, Toggle_Switch
CorpusCount := 0
;DirectoryCount := 0
loop, HTMLTemp\Corpus*.html
CorpusCount := % Floor(A_Index)
Loop, %A_ScriptDir%\HTMLTemp*, 2, 0
DirectoryCount := A_Index-1
;MsgBox, %DirectoryCount%
Filedelete, WorkingDir.txt
FileAppend, %A_ScriptDir%\, WorkingDir.txt
FileRead, ScriptDir, Workingdir.txt
threeRButton=1
loop, Documents\*.pdf
PDFCount := A_Index
If PDFCount != 0
{
PDFCount := PDFCount+1
}
;MsgBox, %PDFCount%
loop, Documents\*.docx
WordCount := A_Index
If WordCount != 0
{
WordCount := WordCount+1
}
If Iniciate=1
{
Return
}
;If !Iniciate=1
Gosub, RButton
Return
;^!v::^
^Up::
^MButton::
ClipBoardEnabled=0
MouseGetPos, mx, my, WinUMID
menu := pm.CreateMenu( menuParams1 )
If Style=1
{
menu.Add( { "name" : " Clipboard Utility"
, "bold" : 1
, "icon" : "Resources\Clipboard Utility.ico" } )
menu.Add()
}
index:=ClipBoardHistory.maxIndex()
if index=
return
while Index>=ClipBoardHistory.minIndex()
{
Description:=ClipBoardHistory[Index]["plain"]
FullDescription:=Description
;if(StrLen(Description)>35)
if(StrLen(Description)>80)
{
toCut:=StrLen(Description)-25
;toCut:=StrLen(Description)-50
;StringMid, itemTemp1, Description, 1, 12
StringMid, itemTemp1, Description, 1, 50
StringTrimLeft, itemTemp2, Description, %toCut%
Description=%itemTemp1%...%itemTemp2%
}
if index<10
MenuString:="&" . (ClipBoardHistory.maxindex()-Index+1) . ". " . Description
else
MenuString:= (ClipBoardHistory.maxindex()-Index+1) . ". " . Description
menu.Add( { "name" : MenuString
, "bold" : 1
, "index" : Index
, "tooltip" : ClipBoardHistory[Index]["plain"]})
index--
}
;WinGet, ActiveWindow , ID, A
MouseGetPos, xpos5, ypos5
xpos5 := xpos5-200
ypos5 := ypos5-100
;item := menu.Show( A_ScreenWidth/3, A_ScreenHeight/3 )
item := menu.Show( xpos5, ypos5 ), Basic Clipboard ; <<<<Menu
;tooltip
WinActivate, ahk_id %WinUMID%
WinWaitActive, ahk_id %WinUMID%
if item
{
ClipBoardEnabled=0
test:=item.index
;tempClip:=clipboard
WinClip.Clear()
clipboard:=ClipBoardHistory[test]["plain"]
;Sleep, 300
send, ^v
;clipboard:=tempClip
;ClipBoardEnabled=1
}
Menu.destroy()
ClipBoardEnabled=1
return
PUM_out( msg, obj )
{
; if ( msg = "onselect" )
; tooltip % obj.tooltip
if ( msg = "oninit" )
{
WinSet, Transparent, 210, ahk_class #32768
}
; tooltip % "menu init: " obj.handle
; if ( msg = "onuninit" )
; tooltip % "menu uninit: " obj.handle
; if ( msg = "onrbutton" )
; tooltip % "Right clicked: " obj.name
; if ( msg = "onmbutton" )
; Clipboard:=obj.name
; ;ClipBoardEnabled=1
; ;tooltip % "Middle clicked: " obj.name
; if ( msg = "onrun" )
; tooltip % "Item runned: " obj.name
}
^F4::
GuiUtily:
global Gui1 := {} ;Main object for everything to do with this gui.
Gui1.Handles := [] ;an array that uses the hwnd of a control as its index position. (this has the name of the controls main object as its values)
Gui1.Active := "" ;The hwnd of the currently hovered button
Gui1.Pressed := "" ;The hwnd of the currently pressed button
;Gui, -Caption +AlwaysOnTop HwndHwnd +Owner
Gui, Utily: -Caption HwndHwnd +Owner
;Gui, Utily: +Owner
Gui1.Hwnd := hwnd
;Gui, -Caption +alwaysontop +ToolWindow
Gui, Utily: Add, Picture, x0 y0 w739 h167, Resources\Clipboard Utility_p_2.png
;Gui, Add, Text, x0 y0 w691 h35 GuiMove ; , `&& Drag
Gui, Utily: Add, Picture, x0 y0 w691 h35 GuiMove, Resources\ArribaIzq1.png
;BUTTON 1
;************************************************************************************************************************
Gui1.Button1 := {} ;Button 1
Gui1.Button1.DefaultImage := "Resources\PDFup.png"
Gui1.Button1.HoverImage := "Resources\PDFhover.png"
Gui1.Button1.PressedImage := "Resources\PDFDown.png"
Gui1.Button1.Label := "SavePDF"
Gui, Utily: Add, Picture, x12 y36 w141 h115 hwndhwnd, % Gui1.Button1.DefaultImage
Gui1.Handles[ hwnd ] := "Button1" ;The name of the control to point at.
Gui1.Button1.Hwnd := hwnd
;************************************************************************************************************************
;BUTTON 2
;************************************************************************************************************************
Gui1.Button2 := {} ;Button 2
Gui1.Button2.DefaultImage := "Resources\WordUp.png"
Gui1.Button2.HoverImage := "Resources\WordOver.png"
Gui1.Button2.PressedImage := "Resources\WordDown.png"
Gui1.Button2.Label := "SaveWord"
Gui, Utily: Add, Picture, x154 y36 w141 h115 hwndhwnd, % Gui1.Button2.DefaultImage
Gui1.Handles[ hwnd ] := "Button2" ;The name of the control to point at.
Gui1.Button2.Hwnd := hwnd
;************************************************************************************************************************
;BUTTON 3
;************************************************************************************************************************
Gui1.Button3 := {} ;Button 3
Gui1.Button3.DefaultImage := "Resources\PasteUp.png"
Gui1.Button3.HoverImage := "Resources\PasteHover.png"
Gui1.Button3.PressedImage := "Resources\PasteDown.png"
Gui1.Button3.Label := "ControlPaste"
Gui, Utily: Add, Picture, x297 y36 w141 h115 hwndhwnd, % Gui1.Button3.DefaultImage
Gui1.Handles[ hwnd ] := "Button3" ;The name of the control to point at.
Gui1.Button3.Hwnd := hwnd
;************************************************************************************************************************
;BUTTON 4
;************************************************************************************************************************
Gui1.Button4 := {} ;Button 4
Gui1.Button4.DefaultImage := "Resources\UrlUp.png"
Gui1.Button4.HoverImage := "Resources\UrlHover.png"
Gui1.Button4.PressedImage := "Resources\UrlDown.png"
Gui1.Button4.Label := "URLButton"
Gui, Utily: Add, Picture, x440 y36 w141 h115 hwndhwnd, % Gui1.Button4.DefaultImage
Gui1.Handles[ hwnd ] := "Button4" ;The name of the control to point at.
Gui1.Button4.Hwnd := hwnd
;************************************************************************************************************************
;BUTTON 5
;************************************************************************************************************************
Gui1.Button5 := {} ;Button 5
Gui1.Button5.DefaultImage := "Resources\HelpUp.png"
Gui1.Button5.HoverImage := "Resources\HelpHover.png"
Gui1.Button5.PressedImage := "Resources\HelpDown.png"
Gui1.Button5.Label := "HelpButton"
Gui, Utily: Add, Picture, x583 y36 w141 h115 hwndhwnd, % Gui1.Button5.DefaultImage
Gui1.Handles[ hwnd ] := "Button5" ;The name of the control to point at.
Gui1.Button5.Hwnd := hwnd
;************************************************************************************************************************
;BUTTON 6
;************************************************************************************************************************
Gui1.Button6 := {} ;Button 6
Gui1.Button6.DefaultImage := "Resources\ExitUp1.png"
Gui1.Button6.HoverImage := "Resources\ExitHover1.png"
Gui1.Button6.PressedImage := "Resources\ExitDown1.png"
;Gui1.Button6.Label := "ExitLabel"
Gui1.Button6.Label := "GuiClose"
Gui, Utily: Add, Picture, x691 y0 w48 h35 hwndhwnd, % Gui1.Button6.DefaultImage
Gui1.Handles[ hwnd ] := "Button6" ;The name of the control to point at.
Gui1.Button6.Hwnd := hwnd
;************************************************************************************************************************
/*
MouseGetPos, xpos2, ypos2
Gui, Show, x%xpos2% y%ypos2% W600 h167, Hover Demo
OnMessage( 0x200 , "ButtonHover" )
OnMessage( 0x201 , "ButtonPress" )
Return
*/
MouseGetPos, xposUtil, yposUtil
If UtilButton=1
{
xposUtil := Floor((A_ScreenWidth/2)-450)
yposUtil := Floor((A_ScreenHeight/2)-200)
}
Gui, Utily: Show, x%xposUtil% y%yposUtil% W739 h167, Hover
OnMessage( 0x200 , "ButtonHover" )
OnMessage( 0x201 , "ButtonPress" )
Return
;************************************************************************************************************************
ButtonHover(){
MouseGetPos,,,, ctrl, 2 ;Get the hwnd of the control under the cursor
if( !Gui1.Active && !Gui1.Pressed && Gui1.Handles[ ctrl ] ){ ;If a button isn't already active (Hover) and if no buttons are being pressed, and there is a match for the control in the Handles array.
Gui1.Active := ctrl ;Assign this control as being the active control
GuiControl,, % Gui1.Active , % Gui1[ Gui1.Handles[ Gui1.Active ] ].HoverImage ;Set the picture to the hover image
SetTimer, WatchLeaveHover, 30 ;Set a timer to watch for the cursor leaving this control (turn off hover)
}
}
WatchLeaveHover: ;checks to see if the control that was being hovered is still being hovered.
MouseGetPos,,,, ctrl, 2 ;Get the hwnd of the control under the cursor
if( Gui1.Pressed ){ ;If a button is being pressed, skip for another 30ms
return
}else if( ctrl != Gui1.Active ){ ;if the control under the cursor isn't the same as the control that is being hovered. (if you move your cursor away from the control)
GuiControl,, % Gui1.Active , % Gui1[ Gui1.Handles[ Gui1.Active ] ].DefaultImage ;Set the picture back to the default image
SetTimer, WatchLeaveHover, Off ;Turn off the timer
Gui1.Active := "" ;empty this so that a new control can be hovered.
}
return
ButtonPress(){
MouseGetPos,,,, ctrl, 2 ;Get the hwnd of the control under the cursor
if( Gui1.Handles[ctrl] ){ ; if the control under the cursor is a valid control.
Gui1.Pressed := ctrl ;Assign this control as being the pressed control
GuiControl,, % Gui1.Pressed , % Gui1[ Gui1.Handles[ Gui1.Pressed ] ].PressedImage ;Set the picture to the pressed image
While( GetKeyState( "LButton" ) ) ;While you continue to hold the mouse down, wait a few ms
Sleep, 30
MouseGetPos,,,, ctrl, 2 ;Get the hwnd of the control under the cursor again
if( ctrl = Gui1.Pressed ){ ;Test to see if it is still the same as the control you clicked on.
GuiControl,, % Gui1.Pressed , % Gui1[ Gui1.Handles[ Gui1.Pressed ] ].HoverImage ;Set the picture to the Hover image
Gui1.Pressed := "" ;empty
try
gosub, % Gui1[ Gui1.Handles[ ctrl ] ].Label ;if the control has a label, run it.
}else{ ;if the control is not the same. Cancel running that controls label and set the control back to its default image.
GuiControl,, % Gui1.Pressed , % Gui1[ Gui1.Handles[ Gui1.Pressed ] ].DefaultImage ;Set the picture to the Default image
Gui1.Pressed := "" ;empty
}
}
}
;************************************************************************************************************************
WUtil:
UtilButton:=1
Gosub, GuiUtily
Return
^F3::
MainProcess:
Gui, Submit
If !ClipBoardEnabled=0
{
ClipBoardEnabled:=0
ChangeClipEnable=1
}
MouseGetPos,,, WinUMID
WinActivate, ahk_id %WinUMID%
last := Clipboard, Clipboard := ""
Send ^c
ClipWait, 0
If ErrorLevel {
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
Return
} Else If (Clipboard = last) {
SoundPlay, Resources\ambiguity2.mp3
TrayTip, Clipboard Message, REPEATED CLIPBOARD!,, 0x2, 0x10, 0x20
Return
} Else {
SoundPlay, Resources\Clipboard_Sound.mp3
TrayTip, Clipboard Message, %Clipboard%,, 0x1, 0x10, 0x20
}
SetTimer, HideTrayTip, -1500
;Data:=clip_GetHtmlString()
accData:= GetAccData()
;******************************************************************************************************************
If not ClipboardGet_HTML( Data )
{
ErrorType :=1
Gosub, ControlError
;MsgBox, The content of the clipboard does not have a valid format to be saved and the operation will be canceled.
Return
}
Else
CorpusCount++
;******************************************************************************************************************
FileTex := "HTMLTemp\Text" CorpusCount ".html"
aData := accData.1
LenText := StrLen(aData)
StringGetPos, pos, aData, -, r1
length := pos-1
StringLeft, OutText, aData, %length%
FileaccData := "HTMLTemp\Name" CorpusCount ".txt"
FileAppend, %OutText%, %FileaccData%, CP65001
;******************************************************************************************************************
FileGetSize, SizeFile, %FileaccData%
If !FileaccData or SizeFile=3
{
ErrorType :=0
Gosub, ControlError
If ErrorTex=0
Return
}
;******************************************************************************************************************
FileURL := "HTMLTemp\URL" CorpusCount ".txt"
2Data := accData.2
FileAppend, %2Data%, %FileURL%, CP65001
Sleep 300
myResult := "<h1><span lang=ES-ES style='font-size:10.0pt;color:#78230C;mso-ansi-language:ES-ES'>Text extracted from:<br></span><span style='font-size:12.0pt'><a href=" accData.2 ">" OutText "</a> <o:p></o:p></span></p></h1>"
FileAppend, %myResult%, %FileTex%
;******************************************************************************************************************
FileGetSize, SizeFile1, %FileTex%
If !FileTex or SizeFile1=3
{
ErrorType :=0
Gosub, ControlError
If ErrorTex=0
Return
}
;******************************************************************************************************************
;ClipboardGet_HTML( Data )
DataReplace := StrReplace(Data, "<h1", "<p")
DataReplace1 := StrReplace(DataReplace, "</h1", "</p")
FileAppend, %DataReplace1%, Temp.html ;, CP65001
;******************************************************************************************************************
FileGetSize, SizeFile2, Temp.html
;MsgBox, %SizeFile2%
FileHTML := "Temp.html"
If !FileHTML or SizeFile2=3
{
ErrorType :=1
Gosub, ControlError
;If ErrorTex=0
Return
}
;******************************************************************************************************************
clipboard=%clipboard%
Plain := "HTMLTemp\TextPlain" CorpusCount ".txt"
FileAppend, %clipboard%, %Plain%, CP65001
Loop, read, Temp.html
{
If A_Index >6
FileAppend, %A_LoopReadLine%`n, TempPDF.html
}
;NameCopy := "HTMLTemp\Temp" CorpusCount ".html"
;FileCopy, TempPDF.html, %NameCopy%
RunWait, %A_WorkingDir%\Addons\conv.exe -b 65001 TempPDF.html temp2.html ,,hide
If SuspendThumbnail=0
{
RunWait, %A_WorkingDir%\Addons\wkhtmltoimage.exe --width 640 temp2.html Image_Temp.jpg,,hide
Gosub, ResizeH
ImageCount := "HTMLTemp\Image" CorpusCount ".jpg"
FileMove, Image_Temp.jpg, %ImageCount%
;**********************
If !ImageCount
{
ErrorType :=2
Gosub, ControlError
}
;**********************
FileDelete, Image_Temp.jpg
}
NameCount := "HTMLTemp\Corpus" CorpusCount ".html"
FileMove, Temp2.html, %NameCount%
FileDelete, Temp*.html
;Gosub, CheckProcess
SoundPlay, Resources\Clipboard_Sound.mp3
TrayTip, Timed TrayTip, Successful Process!, 0x1, 0x10, 0x20
SetTimer, HideTrayTip, -1200
Iniciate:=1
Data :=""
If ChangeClipEnable=1
{
WinClip.Clear()
ClipBoardEnabled=1
ChangeClipEnable=0
}
Gosub, ReloadMenu
Return
ControlError:
If ErrorType =0
{
MsgBox, 0x1024,, You have not been able to save the name of the clipboard source, you will be able to name it later. `nContinue in every way?
IfMsgBox Yes
{
ErrorTex:=1
Return
}
ErrorText:=0
Return
}
If ErrorType =1
{
MsgBox, The content of the clipboard does not have a valid format to be saved and the operation will be canceled.`n(The source of the text must be from the Internet or from formatted Word or PDF files opened with a browser.)
;CorpusCount++
;FileDelete,
Return
}
If ErrorType =2
;{
;MsgBox, 0x1024,, The clipboard image could not be saved. The clipboard exists, but it won't display an image `nContinue in every way?
MsgBox, The clipboard image could not be saved. The clipboard exists, but it will not display an image.`n It can be created later.
*/
IfMsgBox Yes
{
ErrorImg:=1
Return
}
ErrorImg:=0
*/
Return
;}
Return
ResizeH:
filePath := "Image_Temp.jpg"
size := GetImageSize(filePath)
If size.H !>500
return
else
if ErrorLevel
return
crop(FilePath, 0, 0, W, 500)
Return
/*
CheckProcess:
Corpus:= "HTMLTemp\Corpus" CorpusCount ".html"
Corpus:= "HTMLTemp\Image" CorpusCount ".jpg"
Corpus:= "HTMLTemp\name" CorpusCount ".txt"
Corpus:= "HTMLTemp\TextPlain" CorpusCount ".txt"
Corpus:= "HTMLTemp\URL" CorpusCount ".txt"
Corpus:= "HTMLTemp\Text" CorpusCount ".txt"
Return
*/
CopyGui:
CopyButton:=1
;GoSub, Toggle_Switch
Gosub, Menu2
Return
ClipDelete:
StringTrimLeft, DelClip, a_guicontrol, 12
MsgBox, 0x1034,, Do you want to delete the %DelClip%st entrance of the clipboard?
IfMsgBox Yes
{
Gui, 4: Destroy
Gui, ContextClip: Destroy
FileDelete, HTMLTemp\Corpus%DelClip%.html
FileDelete, HTMLTemp\image%DelClip%.jpg
FileDelete, HTMLTemp\Name%DelClip%.txt
FileDelete, HTMLTemp\Text%DelClip%.html
FileDelete, HTMLTemp\TextPlain%DelClip%.txt
FileDelete, HTMLTemp\URL%DelClip%.txt
Loop, %CorpusCount%
if !FileExist("TextPlain" A_Index ".txt")
{
NumberFile := A_Index
FileSup := NumberFile+1
Sup := "HTMLTemp\TextPlain" Filesup ".txt"
NumF:= "HTMLTemp\TextPlain" NumberFile ".txt"
Filemove, %Sup%, %NumF%
Sup := "HTMLTemp\URL" Filesup ".txt"
NumF:= "HTMLTemp\URL" NumberFile ".txt"
Filemove, %Sup%, %NumF%
Sup := "HTMLTemp\Corpus" Filesup ".html"
NumF:= "HTMLTemp\Corpus" NumberFile ".html"
Filemove, %Sup%, %NumF%
Sup := "HTMLTemp\Text" Filesup ".html"
NumF:= "HTMLTemp\Text" NumberFile ".html"
Filemove, %Sup%, %NumF%
Sup := "HTMLTemp\Image" Filesup ".jpg"
NumF:= "HTMLTemp\Image" NumberFile ".jpg"
Filemove, %Sup%, %NumF%
Sup := "HTMLTemp\Name" Filesup ".txt"
NumF:= "HTMLTemp\Name" NumberFile ".txt"
Filemove, %Sup%, %NumF%
}
;CorpusCount--
;Gosub, RButton
Iniciate:=0
Menu, ClipboardID, DeleteAll
;Gosub, IniciateUtility
Gosub, ReloadMenu
}
Return
^F8::
Menu2:
;MouseGetPos, xpos1, ypos1
MouseGetPos, xposMen, yposMen
If CopyButton=1
{
xposMen := Floor(A_ScreenWidth/2)
yposMen := Floor(A_ScreenHeight/2-100)
}
Gui, CopyButtom:Show, x%xposMen% y%yposMen% W81 h84
Return
+RButton::
RButton:
global Gui1 := {} ;Main object for everything to do with this gui.
Gui1.Handles := [] ;an array that uses the hwnd of a control as its index position. (this has the name of the controls main object as its values)
;Gui1.Active := "" ;The hwnd of the currently hovered button
Gui1.Pressed := "" ;The hwnd of the currently pressed button
Gui1.Hwnd := hwnd
FileDelete, SesionName.txt
Gui, ContextClip: new
Gui, 2: new
Gui, 3: new
Loop, %CorpusCount%
{
NameTemp := "HTMLTemp\Name" A_Index ".txt"
FileRead, Name1, %NameTemp%
FileAppend, %Name1%`n, SesionName.txt
}
Loop, read, SesionName.txt
{
posy:=20*(A_Index-1)
Gui, ContextClip: Add, Button, x0 y%posy% w20 h20 hwndIcon hwndIcon8 gGoURL vTURL%A_Index%, %A_Index%
Gui, ContextClip: Add, Button, x520 y%posy% w20 h20 hwndIcon gTxtLabel vTCopy%A_Index%, %A_Index%
Gui, ContextClip: Add, Button, x540 y%posy% w20 h20 hwndIcon1 gTxtPlane vTplane%A_Index%
Gui, ContextClip: Add, Button, x20 y%posy% w20 h20 hwndIcon10 gClipDelete vDeleteButton%A_Index%
Gui, ContextClip: Add, Button, x500 y%posy% w20 h20 hwndIcon9 gTitleEditing vEditing%A_Index%
Gui, ContextClip: Add, Button, x40 y%posy% w460 h20 gButtonLabel vNameButton%A_Index%, %A_LoopReadLine%
GuiButtonIcon(Icon, "Resources\clipboard.ico", 1, "s32")
GuiButtonIcon(Icon1, "Resources\128.ico", 1, "s32")
GuiButtonIcon(Icon8, "Resources\ArrowSmall.ico", 1, "s32")
GuiButtonIcon(Icon10, "Resources\recycle 2.ico", 1, "s32")
GuiButtonIcon(Icon9, "Resources\pencil 1.ico", 1, "s24")
} ; Menu3
Alto := CorpusCount*20+20
posyExit:=20*CorpusCount
;Gui, ContextClip: Margin, 2, 2
;Gui, ContextClip: -Caption +ToolWindow +0x400000 +hWndhMainWnd HwndHwnd ;Menu3s
Gui, ContextClip: -Caption +alwaysontop +ToolWindow +0x400000 +hWndhMainWnd +Owner
;Gui, ContextClip: color,ffffd6
;Gui, Font, S14 Bold, Verdana
;WinSet, Transparent
;Gui, ContextClip:+Owner
posyExitSess := posyExit+20
;LeeSession:= ScriptDir "\HTMLTemp\Session.txt"
LeeSession:= "HTMLTemp\Session.txt"
FileRead, SessClip, %LeeSession%
Gui, ContextClip: Add, Picture, x0 y%posyExit% W560 h32, Resources\Fondo_p.png
Gui, ContextClip: Add, Picture, x0 y%posyExit% W29 h32 gLabelSessionAct0, Resources\IConChange.png
Gui, ContextClip: Add, Picture, x30 y%posyExit% W435 h32 GuiMove, Resources\Resto1.png
;***********************************************************************
Gui1.Button7 := {} ;Button 7
Gui1.Button7.DefaultImage := "Resources\Reducedcap.png"
,Gui1.Button7.HoverImage := "Resources\Close.png"
Gui1.Button7.PressedImage := "Resources\Reducedcap1.png"
;Gui1.Button7.Label := "ReducedM"
Gui, ContextClip: Add, Picture, x487 y%posyExit% W72 h32 gReducedM hwndhwnd, % Gui1.Button7.DefaultImage
Gui1.Handles[ hwnd ] := "Button7" ;The name of the control to point at.
Gui1.Button7.Hwnd := hwnd
;***********************************************************************
Gui1.Button8 := {} ;Button 8
Gui1.Button8.DefaultImage := "Resources\Close.png"
,Gui1.Button8.HoverImage := "Resources\Close.png"
Gui1.Button8.PressedImage := "Resources\Close1.png"
Gui1.Button8.Label := "ExitLabel"
Gui, ContextClip: Add, Picture, x457 y%posyExit% W30 h32 hwndhwnd, % Gui1.Button8.DefaultImage
Gui1.Handles[ hwnd ] := "Button8" ;The name of the control to point at.
Gui1.Button8.Hwnd := hwnd
;***********************************************************************
Gui, ContextClip: Font, S9 Bold, Verdana
posyExitSess1 := posyExit+08
Gui, ContextClip: Add, Text, cYellow BackgroundTrans +Center x2 y%posyExitSess1% vTextTitle W536 h20, %SessClip%
MouseGetPos, xpos1, ypos1
If threeRButton=1
{
xpos1 := Floor((A_ScreenWidth/2)-450)
ypos1 := Floor((A_ScreenHeight/2)-200)
}
If ControlTwo=1
{
xpos1 := XActTwo-140
ypos1 := yActTwo-13
}
;xpos1 := xpos1-560
;ypos1 := ypos1-alto
AltoSess := Alto+12
Gui, ContextClip: Show, x%xpos1% y%ypos1% w560 h%AltoSess% ;Menu3s
VarSetCapacity(tme,16,0)
NumPut(16,tme,0), NumPut(2,tme,4), NumPut(hwnd,tme,8)
OnMessage(0x2A3,"OnMouseLeave")
OnMessage(0x200,"OnMouseMove")
OnMessage( 0x201 , "ButtonPress" )
Gosub, NewWindow
return
RButtonAlt:
threeRButton :=1
Gosub, RButton
Return
TitleEditing:
Gosub, NewWindow
StringTrimLeft, REdit, a_guicontrol, 7
FileChange := "HTMLTemp\Name" REdit ".txt"
FileRead, FileCont, %FileChange%
Gui, Edit: -Caption +alwaysontop +ToolWindow +hWndhMainWnd +Owner
;Gui, Edit:+Owner
Gui, Edit: Font, S10 Bold, Verdana
Gui, Edit: Add, Picture, x0 y0 h20 w564 h32, Resources\Fondo_Limp.png
Gui, Edit: Add, Text, cYellow BackgroundTrans x35 y6 W560 h32 GuiMove, Clipboard Title
Gui, Edit: Add, Text, x0 y33 w563 0x10 ; 0x7 Black
Gui, Edit: Font, S8 Bold, Verdana
Gui, Edit:Add, Edit, x5 y40 w544 h20 vMyEdit, %FileCont%
;Gui, Edit: Add, Edit, x12 y9 w460 h20 vMyEdit%REdit%, %FileCont%
Gui, Edit:Add, Button, x20 y70 w70 h20 gTitleSave, OK
Gui, Edit:Add, Button, x120 y70 w70 h20 gTitleCancel, Cancel
Gui, Edit:Add, CheckBox, x240 y70 w210 h20 Checked1 vVeryfyChange, Change also the Title to Paste
EdXm := pXm-846
EdYm := pYm-148 ;96
Gui, Edit:Show, x%EdXm% y%EdYm% w564
Return
TitleSave:
Gui, Edit: Submit, Destroy
fileAdd := FileOpen(FileChange, "w")
fileAdd.Write(MyEdit)
fileAdd.Close()
If VeryfyChange=1
{
ReadURL := "HTMLTemp\URL" REdit ".txt"
Fileread URLTxt, %ReadURL%
ReadText:= "HTMLTemp\Text" REdit ".html"
FileDelete, %ReadText%
myResultSave := "<h1><span lang=ES-ES style='font-size:10.0pt;color:#78230C;mso-ansi-language:ES-ES'>Text extracted from:<br></span><span style='font-size:12.0pt'><a href=" URLTxt ">" MyEdit "</a> <o:p></o:p></span></p></h1>"
FileAppend, %myResultSave%, %ReadText%
}
MyEdit :=""
FileCont :=""
FileChange :=""
Gosub, RButton
Return
TitleCancel:
Gui, Edit: Destroy
MyEdit :=""
FileCont :=""
FileChange :=""
;Gosub, NewWindow
Gosub, RButton
Return
ReducedM:
WinGetPos, XActOne, YActOne,,, A
Gui, ContextClip: Destroy
SoundPlay, Resources\Close Window.mp3
ControlOne :=1
ControlTwo :=0
Gosub, NotifyTrayClick_207
Return
NotifyTrayClick_207:
FileDelete, SesionName.txt
Gui, ContextClip: new
Gui, 2: new
Gui, 3: new
Loop, %CorpusCount%
{
NameTemp := "HTMLTemp\Name" A_Index ".txt"
FileRead, Name1, %NameTemp%
FileAppend, %Name1%`n, SesionName.txt
}
Loop, read, SesionName.txt
{
posy:=20*(A_Index-1)
Gui, ContextClip1: Add, Button, x0 y%posy% w460 h20 gButtonTwo vTwoButton%A_Index%, %A_LoopReadLine%
} ; Menu3
Alto := CorpusCount*20+20
posyExit:=20*CorpusCount
;Gui, ContextClip1: Margin, 2, 2
Gui, ContextClip1: -Caption +alwaysontop +ToolWindow +0x400000 +hWndhMainWnd +Owner ;Menu31s
Gui, ContextClip1: color,ffffd6
;Gui, Font, S14 Bold, Verdana
;Gui, ContextClip1:+Owner
Gui, ContextClip1: Add, Button, x20 y%posyExit% w380 h20 gExitLabel, Exit Menu
Gui, ContextClip1: Add, Button, x400 y%posyExit% w60 h20 hwndIcon20 gExtendedM
Gui, ContextClip1: Add, Text, x0 y%posyExit% w20 h20 GuiMove
Gui, ContextClip1: Add, Button, x0 y%posyExit% w20 h20 hwndIcon21
AltoT := Floor((CorpusCount+1)*31.5)
XPos:= A_ScreenWidth-(700)
YPos:= A_ScreenHeight-AltoT-60
If threeRButton=1
{
xpos := Floor((A_ScreenWidth/2)-450)
ypos := Floor((A_ScreenHeight/2)-200)
}
If ControlOne=1
{
xPos := XActOne
yPos := YActOne
}
Gui, ContextClip1: Show, x%XPos% y%YPos% w460 h%Alto% ;Menu3s
GuiButtonIcon(Icon21, "Resources\Hand4.ico", 1, "s32")
GuiButtonIcon(Icon20, "Resources\ArrowExt.png", 1, "W90" "H30")
VarSetCapacity(tme,16,0)
NumPut(16,tme,0), NumPut(2,tme,4), NumPut(hwnd,tme,8)
OnMessage(0x2A3,"OnMouseLeave")
OnMessage(0x200,"OnMouseMove")
Gosub, NewWindow
return
ExtendedM:
WinGetPos, XActTwo, YActTwo,,, A
Gui, ContextClip1: Destroy
SoundPlay, Resources\Close Window.mp3
ControlOne :=0
ControlTwo :=1
Gosub, RButton
Return
~+LButton::start := A_TickCount
~+LButton Up::
If (A_TickCount - start < 1200)
Return
MouseGetPos,,, WinUMID
MouseGetPos, xpos1, ypos1
Gui, CopyButtom:Show, x%xpos1% y%ypos1% W79 h87 ;Menu2S
Return
ReducedAlt:
threeRButton :=1
Gosub, NotifyTrayClick_207
Return
GoURL:
StringTrimLeft, TextURL, a_guicontrol, 4
gURL := "HTMLTemp\URL" TextURL ".txt"
FileRead, WebURL, %gURL%
Run, %WebURL%
Return
HelpButton:
SoundPlay, Resources\Close Window.mp3
Gui, Help: New
Gui, Help: -Caption +Owner
;Gui, Help: +Owner
Gui, Help: Color, EEAA99
Gui, Help: Margin, 0, 0
Gui, Help: Add, Picture, x0 y0 w640 h250, Resources\Help.jpg
Gui, Help: Add, Button, x495 y209 w100 h30 gNextButton, More...
Gui, Help: Show, w640 h250
Return
NextButton:
SoundPlay, Resources\Close Window.mp3
Gui, Help: Destroy
Gui, Help2: New
Gui, Help2: -Caption +Owner
;Gui, Help2: +Owner
Gui, Help2: Color, EEAA99
Gui, Help2: Margin, 0, 0
Gui, Help2: Add, Picture, x0 y0 w800 h397, Resources\Clipboard Utility Screenshot.jpg
Gui, Help2: Add, Button, x10 y340 w100 h30 gExitButton, Exit
Gui, Help2: Show, w800 h397
Return
ExitButton:
Gui, Help2: Destroy
Return
!esc::
Gui, 2: Destroy
Gui, ContextClip: Hide
;Gui, 2:default
;Gui, destroy
Return
HideTrayTip:
TrayTip
Return
uiMove:
PostMessage, 0xA1, 2,,, A
Return
GuiEscape:
GuiClose:
ExitCopy:
SoundPlay, Resources\Close Window.mp3
CopyButton=0
UtilButton :=0
Gui, Hide
Gui, CopyButtom:Hide
Return
;*************************************************************************
alert:
if (status_button=status_button_old)
return
Gui, 2:default
Gui, destroy
NumberFile:= RegExReplace(status_button,"\D")
image_file := "HTMLTemp\Image" NumberFile ".jpg"
if !image_file
return
Gui,3:Destroy
Gui,2: -border -caption +toolwindow
Gui, 2: Margin, 2, 2
gui,2: color,202020
gui,2: add,picture,vpic ,%image_file%
Gui,2: Show, x%pXm% y%pYm%
status_button_old:=status_button
return
;*************************************************************************
Deletealert:
if (status_delete=status_delete_old)
return
Gui, 4:default
Gui, destroy
NumberDelete:= RegExReplace(status_delete,"\D")
if !NumberDelete
return
Html =
(
<html><head><Style>
body {background-color: #FFFFF4; overflow: hidden}
p {font-family: 'Raleway-Thin'; font-size: 9pt; }
.words {color: #3d3c3c;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">Delete Clipboard Number %NumberDelete%</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, 4:+AlwaysOnTop -Caption +ToolWindow Border
Gui, 4:margin, 0, 0
Gui, 4:add, ActiveX, vWB w64 h60, HTMLfile
WB.write(html)
children := WB.body.children
maxBottom := 0
Loop % children.length {
rect := children[A_Index - 1].getBoundingClientRect()
(rect.bottom > maxBottom && maxBottom := rect.bottom)
}
maxBottom *= 96/A_ScreenDPI
maxBottom += 15 ; some value you want for the padding-bottom
DelXm := pXm-944
GuiControl, Move, WB, h%maxBottom%
Gui, 4: Show, x%DelXm% y%pYm% w64 h60
status_delete_old:=status_delete
Return
;*************************************************************************
Copyalert:
if (status_Copy=status_Copy_old)
return
Gui, 6:default
Gui, destroy
NumberCopy:= RegExReplace(status_Copy,"\D")
if !NumberCopy
return
Html =
(
<html><head><Style>
body {background-color: #FFFFF4; overflow: hidden}
p {font-family: 'Raleway-Thin'; font-size: 9pt; }
.words {color: #3d3c3c;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">Copy Item %NumberCopy% as Current Clipboard</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, 6:+AlwaysOnTop -Caption +ToolWindow Border
Gui, 6:margin, 0, 0
Gui, 6:add, ActiveX, vWB w60 h72, HTMLfile
WB.write(html)
children := WB.body.children
maxBottom := 0
Loop % children.length {
rect := children[A_Index - 1].getBoundingClientRect()
(rect.bottom > maxBottom && maxBottom := rect.bottom)
}
maxBottom *= 96/A_ScreenDPI
maxBottom += 15 ; some value you want for the padding-bottom
GuiControl, Move, WB, h%maxBottom%
Gui, 6: Show, x%pXm% y%pYm% w60 h72
status_Copy_old:=status_Copy
Return
;*************************************************************************
URLalert:
if (status_URL=status_URL_old)
return
Gui, 5:default
Gui, destroy
NumberURL:= RegExReplace(status_URL,"\D")
URL_file := "HTMLTemp\URL" NumberURL ".txt"
if !URL_file
return
;Gui,2:Destroy
;URL_file := "HTMLTemp\URL" NumberURL ".txt"
FileRead, URLContents, %URL_file%
Html =
(
<html><head><Style>
body {background-color: #FFFFF4; overflow: hidden}
p {font-family: 'Raleway-Thin'; font-size: 10pt; }
.words {color: #3d3c3c;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">Go to: %URLContents%</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, 5:+AlwaysOnTop -Caption +ToolWindow Border
Gui, 5:margin, 0, 0
Gui, 5:add, ActiveX, vWB w562 h30, HTMLfile
WB.write(html)
children := WB.body.children
maxBottom := 0
Loop % children.length {
rect := children[A_Index - 1].getBoundingClientRect()
(rect.bottom > maxBottom && maxBottom := rect.bottom)
}
maxBottom *= 96/A_ScreenDPI
maxBottom += 15 ; some value you want for the padding-bottom
GuiControl, Move, WB, h%maxBottom%
DelXm := pXm-845
;DelXm := pXm-819
DelYm := pYm-47
;Gui, 5: Show, x%DelXm% y%DelYm% w543 h30
Gui, 5: Show, x%DelXm% y%DelYm% w562 h30
status_URL_old:=status_URL
Return
;*************************************************************************
Planealert:
if (status_plane=status_plane_old)
return
Gui, 3:default
Gui, destroy
NumberPlane:= RegExReplace(status_plane,"\D")
Text_file := "HTMLTemp\TextPlain" NumberPlane ".txt"
if !NumberPlane
return
Gui,2:Destroy
Gui,5:Destroy
FileRead, FileContents, %Text_file%
Html =
(
<html><head><Style>
body {background-color: #FFFFF4; overflow: hidden}
p {font-family: 'Raleway-Thin'; font-size: 10pt; }
.words {color: #3d3c3c;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">%FileContents%</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, 3:+AlwaysOnTop -Caption +ToolWindow Border
Gui, 3:margin, 0, 0
Gui, 3:add, ActiveX, vWB w320 h220, HTMLfile
WB.write(html)
children := WB.body.children
maxBottom := 0
Loop % children.length {
rect := children[A_Index - 1].getBoundingClientRect()
(rect.bottom > maxBottom && maxBottom := rect.bottom)
}
maxBottom *= 96/A_ScreenDPI
maxBottom += 15 ; some value you want for the padding-bottom
GuiControl, Move, WB, h%maxBottom%
Gui, 3: Show, x%pXm% y%pYm% w320 h220
status_plane_old:=status_plane
Return
;*************************************************************************
Editingalert:
if (status_Editing=status_Editing_old)
return
Gui, 6:default
Gui, destroy
EditingNumber:= RegExReplace(status_Editing,"\D")
if !EditingNumber
return
Gui,2:Destroy
Gui,5:Destroy
Html =
(
<html><head><Style>
body {background-color: #FFFFF4; overflow: hidden}
p {font-family: 'Raleway-Thin'; font-size: 9pt; }
.words {color: #3d3c3c;}
.reference {color: #00ffff;}
</style></head><body>
<p class="words">Edit Title of the %EditingNumber%th Clipboard</p>
<p class="reference">%f_ref%</p>
</body></html>
)
Gui, 7: +AlwaysOnTop -Caption +ToolWindow Border
;Gui, +AlwaysOnTop -Caption +ToolWindow Border
gui, 7:margin, 0, 0
gui, 7:add, ActiveX, vWB w62 h60, HTMLfile
WB.write(html)
children := WB.body.children
maxBottom := 0
Loop % children.length {
rect := children[A_Index - 1].getBoundingClientRect()
(rect.bottom > maxBottom && maxBottom := rect.bottom)
}
maxBottom *= 96/A_ScreenDPI
maxBottom += 15 ; some value you want for the padding-bottom
;DelXm := pXm-953
GuiControl, Move, WB, h%maxBottom%
gui, 7: Show, x%pXm% y%pYm% w62 h60
status_Editing_old:=status_Editing
Return
;*************************************************************************
^F6::
ControlPaste:
MsgBox, 0x1034,, You have requested to paste all the contents of the clipboard.`nDo you have an open text editor?`n`nMake sure you do not move the mouse, or change the focus on the application.
IfMsgBox No
Return
Else
Sleep, 1000
Gui, Utily: Destroy
;Gui, Hide
MouseGetPos,,, WinUMID
WinActivate, ahk_id %WinUMID%
WinClip.Clear()
Loop, %CorpusCount% ;Loop, %Number% ;so many loops are given as clipboard exist
{
; if (Errorlevel = 1)
; Break
; else if (Errorlevel = 0)
; {
Sleep, 1200
WinClip.Clear()
html := FileOpen("HTMLTemp\Text" A_Index ".html", "r").read()
WinClip.SetHTML(html)
WinClip.Paste()
WinClip.Clear()
Sleep, 300
html := FileOpen("Resources\Line1.html", "r").read()
WinClip.SetHTML(html)
WinClip.Paste()
;WinClip.Paste()
WinClip.Clear()
html := FileOpen("HTMLTemp\Corpus" A_Index ".html", "r").read()
Sleep, 1000
WinClip.SetHTML(html)
WinClip.Paste()
WinClip.Clear()
Sleep, 300
;SendInput {Del}
html := FileOpen("Resources\Line2.html", "r").read()
WinClip.SetHTML(html)
WinClip.Paste()
Send, `n
Sleep, 300
}
;}
TrayTip, Timed TrayTip, Successful Process!, 0x1, 0x10, 0x20
SetTimer, HideTrayTip, -2000
SoundPlay, Resources\Close Window.mp3
Return
^F10::
DeleteAll:
MsgBox, 0x1034,, Do you want to delete all stored clipboards?
IfMsgBox Yes
Gosub, Borrado
Return
^F5::
SavePDF:
MsgBox, 0x1024,, Convert %CorpusCount% Clipboard to a PDF File?
IfMsgBox No
Return
Else
Gui, Utily: Destroy
Sleep, 1000
Loop, %CorpusCount%
{
if (Errorlevel = 1)
Break
else if (Errorlevel = 0)
{
html1 := "HTMLTemp\Text" A_Index ".html"
FileRead, PDF1, %html1%
FileAppend, %PDF1%<br/>, ToPDF.html
html2 := "HTMLTemp\Corpus" A_Index ".html"
FileRead, PDF2, %html2%
FileAppend, %PDF2%<br/>, ToPDF.html
FileRead, html3, Resources\PDFLine.html
FileAppend, %html3%<br/>, ToPDF.html
}
}
;RunWait, %A_WorkingDir%\Addons\conv.exe -b 65001 ToPDF.html TempPDF.html ,,hide
RunWait, %A_WorkingDir%\Addons\wkhtmltopdf.exe ToPDF.html Final_Document.pdf,,hide
PDFCount++
FormatTime, CurrentDate,, dd-MM-yyyy
Filedate := "Documents\Final_Document_" CurrentDate "-" PDFCount ".pdf"
Filedateh := "Documents\ToPDF_" CurrentDate "-" PDFCount ".html"
FileMove, Final_Document.pdf, %Filedate%
Run, %Filedate%
FileMove, ToPDF.html, %Filedateh%
;FileDelete, ToPDF.html
;FileDelete, TempPDF.html
Return
^F7::
SaveWord:
MsgBox, 0x1024,, Convert %CorpusCount% Clipboard to a Word File?
IfMsgBox No
Return
Else
Gui, Utily: Destroy
Sleep, 1000
;ToolTip, Saving clipboard to docx file...
Loop, %CorpusCount%
{
if (Errorlevel = 1)
Break
else if (Errorlevel = 0)
{
html1 := "HTMLTemp\Text" A_Index ".html"
FileRead, PDF1, %html1%
FileAppend, %PDF1%<br/>, ToWord.html, CP65001
;FileRead, Line1, Resources\WordLine.html
;FileAppend, %Line1%, ToWord.html, CP65001
html2 := "HTMLTemp\Corpus" A_Index ".html"
FileRead, PDF2, %html2%
FileAppend, %PDF2%<br/>, ToWord.html, CP65001
FileRead, Line2, Resources\WordLine.html
FileAppend, %Line2%, ToWord.html, CP65001
}
}
WinClip.Clear()
html := FileOpen("ToWord.html", "r").read()
WinClip.SetHTML(html)
Filedelete, WorkingDir.txt
FileAppend, %A_ScriptDir%\, WorkingDir.txt
FileRead, ScriptDir, Workingdir.txt
Clip:= ScriptDir "Word.docx"
ClipToDoc( clip )
WordCount++
FormatTime, CurrentDate,, dd-MM-yyyy
FileWord := ScriptDir "\Documents\Final_Document_" CurrentDate "-" WordCount ".docx"
FileMove, Word.docx, %FileWord%
Run, %FileWord%
FileDelete, ToWord.html
Return
^F11::
;^!z::
DeleteLast:
MsgBox, 0x1034,, Do you want to delete the last entrance of the clipboard?
IfMsgBox Yes
;FileDelete, HTMLTemp\*%CorpusCount%.*
FileDelete, HTMLTemp\Corpus%CorpusCount%.html
FileDelete, HTMLTemp\image%CorpusCount%.jpg
FileDelete, HTMLTemp\Name%CorpusCount%.txt
FileDelete, HTMLTemp\Text%CorpusCount%.html
FileDelete, HTMLTemp\TextPlain%CorpusCount%.txt
FileDelete, HTMLTemp\URL%CorpusCount%.txt
Iniciate:=1
Menu, ClipboardID, DeleteAll
Gosub, ReloadMenu
;CorpusCount--
Return
;************************************************************************************************************************
OnClipboardChange:
if (ClipBoardEnabled=1) and ((A_TickCount-StartTicks)>1)
{
currentClip=%clipboard%
;currentClipAll=%clipboardall%
If (A_EventInfo=1) and (currentClip <> previousClip)
{
previousClip=%clipboard%
If NotifyClip=1
{
TrayTip,, %currentClip%
SoundPlay, Close Window.mp3
SetTimer, HideTrayTip, -1000
}
ClipSave(ClipBoardHistory,currentclip, 15)
}
}
Return
ClipSave(ClipBoardHistory,clip,maxclips=15)
{
ClipBoardHistory.insert(Object())
index:=ClipBoardHistory.MaxIndex()
ClipBoardHistory[index]["plain"]:=clip
;ClipBoardHistory[index]["All"]:=clipall
ClipTemp:= "TempClip\Clip" index ".clip"
If Index<=15
{
FileAppend, %Clip%, %ClipTemp%
}
if (index>maxclips)
{
ClipBoardHistory.Remove(ClipBoardHistory.MinIndex())
FileDelete, TempClip\Clip1.clip
Loop 15
if !FileExist("TempClip\Clip" A_Index ".clip")
{
NumberFile := A_Index
FileSup := NumberFile+1
Sup := "TempClip\Clip" Filesup ".clip"
NumF:= "TempClip\Clip" NumberFile ".clip"
Filemove, %Sup%, %NumF%
}
FileAppend, %Clip%, TempClip\Clip15.clip
}
}
;************************************************************************************************************************
^Esc::
Exit:
ExitApp
Return
Borrado:
FileDelete, HTMLTemp\Text*.html
FileDelete, HTMLTemp\Corpus*.html
FileDelete, HTMLTemp\image*.jpg
FileDelete, HTMLTemp\Name*.txt
FileDelete, HTMLTemp\TextPlain*.txt
FileDelete, HTMLTemp\URL*.txt
Iniciate:=1
Menu, ClipboardID, DeleteAll
Gosub, LabelSessionAct1
CorpusCount :=0
;Gosub, ReloadSession
Gosub, ReloadMenu
Return
ButtonTwo:
StringTrimLeft, NumberFile, a_guicontrol, 9
;Gui, 2: Destroy
;Gui, ContextClip: Destroy
Gosub, ButtonLabel
Return
LabelSession:
;NumberFile:=A_ThisMenuItemPos
;Menu, tray, ToggleCheck, &Suspend Clipboard Utility
;Menu, tray, ToggleCheck, Clipboard Sessions
MsgBox, 0x1024,, You want the session %A_ThisMenuItem% to be the default session?
IfMsgBox No
Return
;Loop, %DirectoryCount%
/*
if !FileExist("HTMLTemp" A_Index)
{
;NumberDir : %A_Index%
MoveDir := "HTMLTemp" A_Index
}
MsgBox, %MoveDir%
*/
FileDelete, SessionTemp*.txt
FileDelete, SessionTemp00.txt
FileDelete, SessionTemp01.txt
Loop, %A_ScriptDir%\HTMLTemp*, 2, 0
NumSess := A_Index-1
NumberPos:= A_ThisMenuItemPos-4
;MsgBox, %NumberPos%
FileAppend, %A_ScriptDir%, SessionTemp.txt
FileSession := "\HTMLTemp"
FileAppend, %FileSession%, SessionTemp.txt
FileAppend, %A_ScriptDir%, SessionTemp00.txt
FileSession2 := "\HTMLTemp00"
FileAppend, %FileSession2%, SessionTemp00.txt
FileRead, DirectorySess, SessionTemp.txt
FileRead, DirectorySess00, SessionTemp00.txt
;FileMove %DirectorySess%, %DirectorySess00%
FileMoveDir %DirectorySess%, %DirectorySess00%, R
;DirectorySess :=""
;DirectorySess00 :=""
FileAppend, %A_ScriptDir%, SessionTemp01.txt
FileSession3 := "\HTMLTemp" NumberPos
FileAppend, %FileSession3%, SessionTemp01.txt
FileRead, DirectorySess01, SessionTemp01.txt
FileRead, DirectorySess, SessionTemp.txt
FileRead, DirectorySess00, SessionTemp00.txt
;MsgBox, %DirectorySess01%`n%DirectorySess%
FileMoveDir %DirectorySess01%, %DirectorySess%, R
FileMoveDir %DirectorySess00%, %DirectorySess01%, R
Menu, SessionID, DeleteAll
Menu, ClipboardID, DeleteAll
Iniciate:=0
Gosub, ReloadSession
Return
ButtonLabelTray:
If CorpusCount=0
Return
NumberFile:=A_ThisMenuItemPos
Gosub, ButtonLabel
Return
ButtonLabel:
;NumberFile:= RegExReplace(NameTwo,"\D")
Gosub, ExitLabel
MouseGetPos,,, WinUMID
WinActivate, ahk_id %WinUMID%
Sleep, 1000
WinClip.Clear()
html := FileOpen("HTMLTemp\Text" NumberFile ".html", "r").read()
WinClip.SetHTML(html)
WinClip.Paste()
WinClip.Clear()
Sleep, 300
html := FileOpen("Resources\Line1.html", "r").read()
WinClip.SetHTML(html)
WinClip.Paste()
WinClip.Clear()
html := FileOpen("HTMLTemp\Corpus" NumberFile ".html", "r").read()
Sleep, 1000
WinClip.SetHTML(html)
WinClip.Paste()
WinClip.Clear()
Sleep, 300
html := FileOpen("Resources\Line2.html", "r").read()
WinClip.SetHTML(html)
WinClip.Paste()
Send, `n
Sleep, 300
Return
ExitLabel:
SoundPlay, Resources\Close Window.mp3
Gui, ContextClip1: Destroy
Gui, ContextClip: Destroy
;Gui, Destroy
Gui,2: Destroy
Gui, Gui1: Destroy
;Gui, 2:default
;Gui, destroy
Gui,3: Destroy
Gui,4: Destroy
Gui,5: Destroy
Gui,6: Destroy
Gui,7: Destroy
ControlOne :=0
ControlTwo :=0
threeRButton :=0
Alto:=0
Return
TxtLabel:
SoundPlay, Resources\Clipboard_Sound.mp3
StringTrimLeft, TextCopy, a_guicontrol, 5
Gosub, ExitLabel
Sleep, 300
WinClip.Clear()
htmlTx := FileOpen("HTMLTemp\Corpus" TextCopy ".html", "r").read()
WinClip.SetHTML(htmlTx)
Return
TxtPlane:
MouseGetPos,,, WinUMID
WinActivate, ahk_id %WinUMID%
StringTrimLeft, TextPlane, a_guicontrol, 6
Gosub, ExitLabel
Sleep, 300
WinClip.Clear()
htmlPl := FileOpen("HTMLTemp\TextPlain" TextPlane ".txt", "r").read()
Clipboard = %htmlPl%
Send, ^v
Return
Toggle_Switch:
If Toggle=0
{
GuiControl, Hide, State0
GuiControl, Show, State1
Toggle=1
}
Else {
GuiControl, Hide, State1
GuiControl, Show, State0
Toggle=0
}
Return
SubRoutine1:
GoSub,Toggle_Switch
If Toggle=0
{
Hotkey, +LButton Up, on
;Gui, Destroy
Return
}
If Toggle=1
{
Hotkey, +LButton Up, off
;Gui, Destroy
Return
}
CopyTexClip:
Gui, Submit
WinActivate, ahk_id %WinUMID%
Gosub, MainProcess
Return
NewWindow:
WinGetPos pXm, pYm, Width, Height, ahk_id %hMainWnd%
pXm := pXm + Width
If (A_OSVersion ~= "WIN_(7|XP)") {
SysGet BorderW, 32 ; SM_CXFRAME
pXm += BorderW + 1
}
Return
ClipboardGet_HTML( byref Data ) ;www.autohotkey.com/forum/viewtopic.php?p=392624#392624
{
If CBID := DllCall( "RegisterClipboardFormat", Str,"HTML Format", UInt )
If DllCall( "IsClipboardFormatAvailable", UInt,CBID ) <> 0
If DllCall( "OpenClipboard", UInt,0 ) <> 0
If hData := DllCall( "GetClipboardData", UInt,CBID, UInt )
DataL := DllCall( "GlobalSize", UInt,hData, UInt )
, pData := DllCall( "GlobalLock", UInt,hData, UInt )
, VarSetCapacity( data, dataL * ( A_IsUnicode ? 2 : 1 ) ), StrGet := "StrGet"
, A_IsUnicode ? Data := %StrGet%( pData, dataL, 0 )
: DllCall( "lstrcpyn", Str,Data, UInt,pData, UInt,DataL )
, DllCall( "GlobalUnlock", UInt,hData )
DllCall( "CloseClipboard" )
Return dataL ? dataL : 0
}
GuiButtonIcon(Handle, File, Index := 1, Options := "")
{
RegExMatch(Options, "i)w\K\d+", W), (W="") ? W := 16 :
RegExMatch(Options, "i)h\K\d+", H), (H="") ? H := 16 :
RegExMatch(Options, "i)s\K\d+", S), S ? W := H := S :
RegExMatch(Options, "i)l\K\d+", L), (L="") ? L := 0 :
RegExMatch(Options, "i)t\K\d+", T), (T="") ? T := 0 :
RegExMatch(Options, "i)r\K\d+", R), (R="") ? R := 0 :
RegExMatch(Options, "i)b\K\d+", B), (B="") ? B := 0 :
RegExMatch(Options, "i)a\K\d+", A), (A="") ? A := 4 :
Psz := A_PtrSize = "" ? 4 : A_PtrSize, DW := "UInt", Ptr := A_PtrSize = "" ? DW : "Ptr"
VarSetCapacity( button_il, 20 + Psz, 0 )
NumPut( normal_il := DllCall( "ImageList_Create", DW, W, DW, H, DW, 0x21, DW, 1, DW, 1 ), button_il, 0, Ptr ) ; Width & Height
NumPut( L, button_il, 0 + Psz, DW ) ; Left Margin
NumPut( T, button_il, 4 + Psz, DW ) ; Top Margin
NumPut( R, button_il, 8 + Psz, DW ) ; Right Margin
NumPut( B, button_il, 12 + Psz, DW ) ; Bottom Margin
NumPut( A, button_il, 16 + Psz, DW ) ; Alignment
SendMessage, BCM_SETIMAGELIST := 5634, 0, &button_il,, AHK_ID %Handle%
return IL_Add( normal_il, File, Index )
}
OnMouseMove( wParam, lParam, Msg,hwnd ) {
global status_button ,tme
global status_Plane ,tme
global status_Print ,tme
global status_Delete ,tme
global status_URL ,tme
global status_Copy ,tme
global status_Editing ,tme
DllCall( "TrackMouseEvent","uint",&tme )
status_button:=""
status_Plane:=""
Status_Print:=""
status_Delete:=""
status_URL:=""
status_Copy:=""
status_Editing:=""
if instr(a_guicontrol,"BUTTON")
{
status_button:=a_guicontrol
SetTimer, alert,-20
}
if instr(a_guicontrol,"plane")
{
status_Plane:=a_guicontrol
SetTimer, Planealert,-20
}
if instr(a_guicontrol,"Print")
{
status_Print:=a_guicontrol
SetTimer, Printalert,-20
}
if instr(a_guicontrol,"Delete")
{
status_Delete:=a_guicontrol
SetTimer, Deletealert,-20
}
if instr(a_guicontrol,"URL")
{
status_URL:=a_guicontrol
SetTimer, URLalert,-20
}
if instr(a_guicontrol,"Copy")
{
status_Copy:=a_guicontrol
SetTimer, Copyalert,-20
}
if instr(a_guicontrol,"Editing")
{
status_Editing:=a_guicontrol
SetTimer, Editingalert,-20
}
}
OnMouseLeave(){
global
Gosub, NewWindow
Gui,2: Destroy
Gui,3: Destroy
Gui,4: Destroy
Gui,5: Destroy
Gui,6: Destroy
Gui,7: Destroy
status_button_old:=""
status_plane_old:=""
status_print_old:=""
status_Delete_old:=""
status_URL_old:=""
status_Copy_old:=""
status_Editing_old:=""
}
Printalert:
if (status_Print=status_print_old)
return
URLButton:
SoundPlay, Resources\Close Window.mp3
MsgBox, 0x1024,, Extract URL's from Clipboards?
IfMsgBox No
Return
Else
Gui, Utily: Destroy
Loop, %CorpusCount%
{
if (Errorlevel = 1)
Break
else if (Errorlevel = 0)
{
html1 := "HTMLTemp\Text" A_Index ".html"
FileRead, PDF1, %html1%
FileAppend, %PDF1%<br/>, ToPDF.html
html2 := "HTMLTemp\Corpus" A_Index ".html"
FileRead, PDF2, %html2%
FileAppend, %PDF2%<br/>, ToPDF.html
}
}
Gosub, ExtractURL
FileDelete, ToPDF.html
Return
NotifyTrayClick(P*) { ; v0.41 by SKAN on D39E/D39N @ tiny.cc/notifytrayclick
Static Msg, Fun:="NotifyTrayClick", NM:=OnMessage(0x404,Func(Fun),-1), Chk,T:=-250,Clk:=1
If ( (NM := Format(Fun . "_{:03X}", Msg := P[2])) && P.Count()<4 )
Return ( T := Max(-5000, 0-(P[1] ? Abs(P[1]) : 250)) )
Critical
If ( ( Msg<0x201 || Msg>0x209 ) || ( IsFunc(NM) || Islabel(NM) )=0 )
Return
Chk := (Fun . "_" . (Msg<=0x203 ? "203" : Msg<=0x206 ? "206" : Msg<=0x209 ? "209" : ""))
SetTimer, %NM%, % (Msg==0x203 || Msg==0x206 || Msg==0x209)
? (-1, Clk:=2) : ( Clk=2 ? ("Off", Clk:=1) : ( IsFunc(Chk) || IsLabel(Chk) ? T : -1) )
Return True
}
;************************************************************************************************************************
ExtractURL:
;Create header html document
FileAppend,
(
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=AutoHotkey.File>
<meta name=Generator content="AutoHotkey">
</head>
<body lang=es style='font-family:Calibri;font-size:11.0pt'>
), Extracted_Links.html
FormatTime, CurrentDate,, dd-MM-yyyy
DateIncl := "<p style='margin:0in'><span style='font-family:Times New Roman;font-size:11.0pt;color:#1E4D78'>Clipboard Session URLs: </span><span style='font-weight:bold;font-family:Calibri;font-size:12.0pt;color:#860000'>" CurrentDate "</span></p>"
FileAppend, %DateIncl%, Extracted_Links.html
;Add Line
myResult := "<p style='margin:0in;font-family:Calibri;font-size:11.0pt;color:#78230C'><p style='margin:0in'><span style='font-family:Courier;font-size:10.0pt;font-weight:bold'>───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<br><ul type=disc style='direction:ltr;unicode-bidi:embed;margin-top:0in;margin-bottom:0in'>`r
<p style='margin:0in;font-family:Calibri;font-size:11.0pt'> </p>`r"
FileAppend, %myResult%, Extracted_Links.html
;Routine loop, origin: https://www.autohotkey.com/docs/commands/LoopReadFile.htm
LinkCount := 0
ImgCount := 0
Loop, read, ToPDF.html, Extracted_Links.html
{
URLSearchString := A_LoopReadLine
Gosub, URLSearch
}
FileAppend,
(
</ul>
<p style='margin:0in;font-family:Calibri;font-size:11.0pt'> </p>
<p style='margin:0in'><span style='font-family:Courier;font-size:10.0pt;font-weight:bold'>───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<br><ul type=disc style='direction:ltr;unicode-bidi:embed;margin-top:0in;margin-bottom:0in'>
<!--EndFragment-->
</body>
</html>
), Extracted_Links.html
Loop, read, Extracted_Links.html
{
If A_Index < 11
FileAppend, %A_LoopReadLine%`n, Extracted_Links_Img.html
if A_Index > 11
if RegExMatch(A_LoopReadLine, "\.(jpg<|jpeg<|png<|gif<|svg<)")
{
FileAppend, %A_LoopReadLine%`n, Extracted_Links_Img.html
ImgCount++ ; increment by one
}
else If InStr(A_LoopReadLine, "</ul>", True) and A_Index > 17
FileAppend,
(
</ul>
<p style='margin:0in;font-family:Calibri;font-size:11.0pt'> </p>
<p style='margin:0in'><span style='font-family:Courier;font-size:10.0pt;font-weight:bold'>───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<br><ul type=disc style='direction:ltr;unicode-bidi:embed;margin-top:0in;margin-bottom:0in'>
<!--EndFragment-->
</body>
</html>
), Extracted_Links_Img.html
}
;URL number message, Optional
MsgBox %LinkCount% links were found and written to "Extracted_Links.html" `n %ImgCount% Images were found and written to "Extracted_Links_Img.html"
;Opcional, opens the result
FormatTime, CurrentDate,, dd-MM-yyyy
FileURL := "Documents\Extracted_Links_" CurrentDate ".html"
FileURLImg := "Documents\Extracted_Links_Img_" CurrentDate ".html"
FileMove, Extracted_Links.html, %FileURL%
FileMove, Extracted_Links_Img.html, %FileURLImg%
FileDelete, ToPDF.html
Run, %FileURL%
Run, %FileURLImg%
return
URLSearch:
; It's done this particular way because some URLs have other URLs embedded inside them:
URLStart1 := InStr(URLSearchString, "https://")
URLStart2 := InStr(URLSearchString, "http://")
URLStart3 := InStr(URLSearchString, "ftp://")
URLStart4 := InStr(URLSearchString, "www.")
; Find the left-most starting position:
URLStart := URLStart1 ; Set starting default.
Loop
{
; It helps performance (at least in a script with many variables) to resolve
; "URLStart%A_Index%" only once:
ArrayElement := URLStart%A_Index%
if (ArrayElement = "") ; End of the pseudo-array has been reached.
break
if (ArrayElement = 0) ; This element is disqualified.
continue
if (URLStart = 0)
URLStart := ArrayElement
else ; URLStart has a valid position in it, so compare it with ArrayElement.
{
if (ArrayElement != 0)
if (ArrayElement < URLStart)
URLStart := ArrayElement
}
}
if (URLStart = 0) ; No URLs exist in URLSearchString.
return
; Otherwise, extract this URL:
URL := SubStr(URLSearchString, URLStart) ; Omit the beginning/irrelevant part.
Loop, parse, URL, %A_Tab%%A_Space%<> ; Find the first space, tab, or angle (if any).
{
URL := A_LoopField
break ; i.e. perform only one loop iteration to fetch the first "field".
}
StringReplace, URLCleansed, URL, ",, All
; Makes a second check to replace extraneous signs.
FixString := % URLCleansed
vList := "
(
%21 !
%23 #
%24 $
%26 &
%27 '
%28 (
%29 )
%2A *
%2B +
%2C ,
%3B ;
%2F /
%3A :
%3D =
%3F ?
%40 @
%5B [
%5D ]
%20
%C2%B4 ´
%2E .
%25 %
%2D -
%3C <
%3E >
%5C \
%5E ^
%5F _
%60 `
%7B {
%7C |
%7D }
%7E ~
%22 ""
\/ \
)"
Loop, Parse, vList, `n
{
oTemp := StrSplit(A_LoopField, "`t")
FixString := StrReplace(FixString, oTemp.1, oTemp.2)
}
oTemp := ""
ClipBoard := "<li style='margin-top:0;margin-bottom:0;vertical-align:middle'><p style='margin:0in;font-family:Calibri;font-size:10.0pt'><a href=" FixString ">" FixString "</a></p></li>"
FileAppend, %ClipBoard%`n
LinkCount += 1
; See if there are any other URLs in this line:
CharactersToOmit := StrLen(URL)
CharactersToOmit += URLStart
URLSearchString := SubStr(URLSearchString, CharactersToOmit)
Gosub, URLSearch ; Recursive call to self.
return
;**********************************************************************************************
^F1::
CaseMenu:
Menu Case, Add
Menu Case, DeleteAll
Menu Case, Add, &UPPERCASE, CCase
Menu Case, Add, &lowercase, CCase
Menu Case, Add, &Title Case, CCase
Menu Case, Add, &a Title to Case, CCase
Menu Case, Add, &Sentence case, CCase
Menu Case, Add
Menu Case, Add, &Remove Spaces, CCase
GetText(Txt)
If NOT ERRORLEVEL
Menu Case, Show
Return
CCase:
p:=A_ThisMenuItemPos
If (p=1)
StringUpper, Txt, Txt
Else If (p=2)
StringLower, Txt, Txt
Else If (p=3)
StringLower, Txt, Txt, T
Else If (p=4)
{
StringLower, Txt, Txt
;IMPORTANT! Change short words to be replaced in the following list according to each language or add more
lowers := ["a", "ha", "el", "y", "pero", "o", "para", "las", "es", "para", "por", "los", "con", "en", "que", "un", "de", "del", "la", "una", "cada", "en", "al", "por", "uno", "mi", "tu", "tú", "no", "ni", "sin", "se", "lo", "e", "su", "sí", "ser", "hay"]
for k, v in lowers
low .= (k = 1 ? "" : "|") . v
;Txt := RegExReplace(Txt, "(*UCP)(^\b|\b(?!(" . low . ")\b))\w+\b|\b\w+\b$", "$T0")
;Txt := RegExReplace(Txt, "((?:^|[.!?-]\s+)[a-z])", "$u1")
Txt := RegExReplace(Txt, "(*UCP)(^|\b(?!(" . low . ")\b))\w|(\.|\?|!)\s*\K\w|-\K\w", "$T0")
}
Else If (p=5)
{
StringLower, Txt, Txt
Txt := RegExReplace(Txt, "((?:^|[.!?]\s+)[a-z])", "$u1")
}
Else If (p=7)
{
Loop
{
StringReplace, Txt, Txt, %A_Space%%A_Space%, %A_Space%, UseErrorLevel
if ErrorLevel = 0
break
}
}
PutText(Txt)
Return
GetText(ByRef MyText = "")
{
SavedClip := ClipboardAll
Clipboard =
Send ^{vk43} ;Ctrl C
ClipWait 0.5
If ERRORLEVEL
{
Clipboard := SavedClip
MyText =
Return
}
MyText := Clipboard
Clipboard := SavedClip
Return MyText
}
PutText(MyText)
{
SavedClip := ClipboardAll
Clipboard =
Sleep 20
Clipboard := MyText
Send ^{vk56} ;Ctrl V
Sleep 100
Clipboard := SavedClip
Return
}
ClipToDoc(FileName) {
oWord := ComObjCreate("Word.Application")
Document := oWord.Documents.Add
; oWord.Selection.Paste
oWord.Selection.PasteAndFormat(16) ; wdFormatOriginalFormatting = 16
Document.SaveAs(FileName)
Document.Close()
oWord.Quit
}
GetImageSize(imageFilePath) {
if !hBitmap := LoadPicture(imageFilePath, "GDI+")
throw "Failed to load the image"
VarSetCapacity(BITMAP, size := 4*4 + A_PtrSize*2, 0)
DllCall("GetObject", "Ptr", hBitmap, "Int", size, "Ptr", &BITMAP)
DllCall("DeleteObject", "Ptr", hBitmap)
Return { W: NumGet(BITMAP, 4, "UInt"), H: NumGet(BITMAP, 8, "UInt") }
}
crop(FilePath, x, y, w, h) {
static IP
img := ComObjCreate("WIA.ImageFile")
img.LoadFile(FilePath)
if (!IP) {
IP:=ComObjCreate("WIA.ImageProcess")
ip.Filters.Add(IP.FilterInfos("Crop").FilterID)
}
; x,y,r,b are the number of pixels to crop from each edge. They cannot be negative numbers.
ip.filters[1].properties("Left") := x
ip.filters[1].properties("Top") := y
if ((r := img.width - w - x) < 1)
r := 0
if ((b := img.height - h - y) < 1)
b := 0
ip.filters[1].properties("Right") := r
ip.filters[1].properties("Bottom") := b
img := IP.Apply(img)
FileDelete, %FilePath%
while FileExist(FilePath)
Sleep, 10
img.SaveFile(FilePath)
return
}
;*******************************************************************************
Nothing:
Run, https://www.autohotkey.com/boards/viewtopic.php?t=92963
Return
Tray_Open:
ListLines
return
^!F4::
NewSession:
Gui, Session: -Caption +alwaysontop +ToolWindow +hWndhMainWnd +Owner
;Gui, Session:+Owner
Gui, Session: Font, S10 Bold, Verdana
Gui, Session: Add, Picture, x0 y0 h20 w562 h32, Resources\Fondo_Limp.png
Gui, Session: Add, Text, cYellow BackgroundTrans x35 y6 W560 h32 GuiMove, Session Name
;Gui, RenSession: Add, Text, x5 y6 h20 w549, Session Name:
Gui, Session: Add, Text, x0 y33 w563 0x10 ; 0x7 Black
Gui, Session: Font, S8 Bold, Verdana
Gui, Session: Add, Edit, x5 y40 vSessEdit h20 w544, New Session
Gui Session:Add, Button, x20 y70 w70 h20 gSessionSave, OK
Gui Session:Add, Button, x120 y70 w70 h20 gSessCancel, Cancel
xSess := Floor((A_ScreenWidth/2)-448)
ySess := Floor((A_ScreenHeight/2)-200)
Gui, Session: Show, x%xSess% y%ySess% w562
Return
SessionSave:
FileDelete, SessionTemp.txt
Gui, Session: Submit
Loop, %A_ScriptDir%\HTMLTemp*, 2, 0
SessionTotal1 := A_Index
FileCreateDir, HTMLTemp%SessionTotal1%
FileAppend, %A_ScriptDir%, SessionTemp.txt
FileSession := "\HTMLTemp" SessionTotal1 "\Session.txt"
FileAppend, %FileSession%, SessionTemp.txt
;Sleep, 3500
FileRead, Directory, SessionTemp.txt
FileAppend, %SessEdit%, %Directory%
Menu, SessionID, DeleteAll
Iniciate:=1
;Gosub, NewWindow
SessEdit :=""
Gosub, ReloadSession
Return
SessCancel:
Gui, Session:Destroy
Gui, RenSession:Destroy
SessEdit :=""
ReSessEdit :=""
Gosub, RButton
Return
LabelSessionAct0:
Position :=0
Gosub, LabelSessionAct
Return
LabelSessionAct1:
Position :=1
;MsgBox, HOLA!!!
Gosub, LabelSessionAct
Return
LabelSessionAct:
Gosub, NewWindow
ReadSess := "HTMLTemp\Session.txt"
FileRead, RenSession, %ReadSess%
Gui, RenSession: -Caption +alwaysontop +ToolWindow +hWndhMainWnd
; Gui, RenSession:+Owner
Gui, RenSession: Font, S10 Bold, Verdana
Gui, RenSession: Add, Picture, x0 y0 h20 w564 h32, Resources\Fondo_Limp.png
Gui, RenSession: Add, Text, cYellow BackgroundTrans x35 y6 W560 h32 GuiMove, Session Name
;Gui, RenSession: Add, Text, x5 y6 h20 w549, Session Name:
Gui, RenSession: Add, Text, x0 y33 w563 0x10 ; 0x7 Black
Gui, RenSession: Font, S8 Bold, Verdana
Gui, RenSession: Add, Edit, x5 y40 vReSessEdit h20 w544, %RenSession%
Gui RenSession:Add, Button, x20 y70 w70 h20 gRenSessionSave, OK
Gui RenSession:Add, Button, x120 y70 w70 h20 gSessCancel, Cancel
If Position=0
{
xSess := pXm-846
ySess := pYm-148 ;96
}
If Position=1
{
xSess := Floor((A_ScreenWidth/2)-448)
ySess := Floor((A_ScreenHeight/2)-200)
}
Gui, RenSession: Show, x%xSess% y%ySess% w564
Return
RenSessionSave:
Gui, RenSession: Submit
FileDelete, HTMLTemp\Session.txt
FileAppend, %ReSessEdit%, HTMLTemp\Session.txt
ReSessEdit :=""
Gosub, RButton
Return
/*
Paused:
Paused:=!Paused
IfEqual,Paused,1, Menu,Tray,Icon,%A_ScriptDir%\Resources\Scissors_Orange.ico
IfEqual,Paused,0, Menu,Tray,Icon,%A_ScriptDir%\Resources\Scissors_Green.ico
Menu, tray, ToggleCheck, &Pause Script
Menu,Tray,Icon,,,1
Pause,Toggle,1
Return
*/
DeleteSessions:
MsgBox, 0x1034,, Do you Really want to Delete the Empty Sessions? `n`n Can be Used on Another Occasion.
IfMsgBox No
Return
IndiDir := 0
SumDir := 0
loop, %SessionTotal%
{
FileDelete, SessionCount.txt
FileAppend, %A_ScriptDir%, SessionCount.txt
FullFile:="\HTMLTemp" A_Index "\*.*"
NameDir := "HTMLTemp" A_Index
FileAppend, %FullFile%, SessionCount.txt
FileRead, CountFiles, SessionCount.txt
loop, %CountFiles%
FilesCount := % Floor(A_Index/6)
;MsgBox, %FilesCount% - %NameDir%
If FilesCount=0
{
FileRemoveDir, %NameDir%, 1
IndiDir--
SumDir++
}
}
If InDir<>DirectoryCount
{
Loop %SumDir%
{
Loop %DirectoryCount%
if !FileExist("HTMLTemp" A_Index)
{
NumberFile1 := A_Index
FileSup1 := NumberFile1+1
Sup1 := ScriptDir "HTMLTemp" Filesup1
NumF1:= ScriptDir "HTMLTemp" NumberFile1
;MsgBox, %Sup1% - %NumF1%
FileMoveDir %Sup1%, %NumF1%, R
;Filemove, %Sup%, %NumF%
;FileMoveDir %DirectorySess%, %DirectorySess00%, R
}
}
DirectoryCount:=DirectoryCount-SumDir
Menu, SessionID, DeleteAll
Gosub, ReloadSession
}
Return
^F12::
Stanby:
Suspend:=!Suspend
IfEqual,Suspend,1, Menu,Tray,Icon,%A_ScriptDir%\Resources\Scissors_Red.ico
IfEqual,Suspend,0, Menu,Tray,Icon,%A_ScriptDir%\Resources\Scissors_Green.ico
Menu, tray, ToggleCheck, &Suspend Clipboard Utility
Menu,Tray,Icon,,,1
Suspend,Toggle
Return
SuspendHotkeys:
Menu, Tray, ToggleCheck, Keep Only Hotkeys Necessary
xSplash1 := A_ScreenWidth-506
ySplash1 := A_ScreenHeight-180
If SuspendHotkeys=1
{
SuspendHotkeys:=0
Hotkey, ^Up, Toggle
Hotkey, ^F4, Toggle
Hotkey, ^F5, Toggle
Hotkey, ^F6, Toggle
Hotkey, ^F7, Toggle
Hotkey, ^F8, Toggle
Hotkey, ^F10, Toggle
Hotkey, ^F11, Toggle
Hotkey, ^F12, Toggle
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Activated Only the Necessary Hotkeys
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
else
{
SuspendHotkeys:=1
Hotkey, ^Up, Toggle
Hotkey, ^F4, Toggle
Hotkey, ^F5, Toggle
Hotkey, ^F6, Toggle
Hotkey, ^F7, Toggle
Hotkey, ^F8, Toggle
Hotkey, ^F10, Toggle
Hotkey, ^F11, Toggle
Hotkey, ^F12, Toggle
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Activated All Hotkeys
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
Return
SuspendThumbnail:
Menu, ThumbnailID, ToggleCheck, Postpone Thumbnail Creation
xSplash1 := A_ScreenWidth-506
ySplash1 := A_ScreenHeight-180
If SuspendThumbnail=0
{
SuspendThumbnail:=1
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Thumbnail Creation Disabled
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
else
{
SuspendThumbnail:=0
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Thumbnail Creation Enabled
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
Return
SuspendBasicClip:
Menu, BasicClipID, ToggleCheck, Disable Basic Clipboard
xSplash1 := A_ScreenWidth-506
ySplash1 := A_ScreenHeight-180
If ClipBoardEnabled=0
{
ClipBoardEnabled:=1
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Basic Clipboard Enabled
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
else
{
ClipBoardEnabled:=0
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Basic Clipboard Disabled
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
Return
SuspendNotifClip:
Menu, BasicClipID, ToggleCheck, Deactivate Notifications in Tray
xSplash1 := A_ScreenWidth-506
ySplash1 := A_ScreenHeight-180
If NotifyClip=0
{
NotifyClip:=1
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification,Notifications in Tray Enabled
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
else
{
NotifyClip:=0
SoundPlay, Resources\Close Window.mp3
SplashTextOn,500, 80, Notification, Notifications in Tray Disabled
WinMove, Notification,, xSplash1, ySplash1
Sleep, 1500
SplashTextOff
}
Return
DeleteBasic:
MsgBox, 0x1024,, Want to Delete all Basic Clipboards? `n`n It will be Deleted from the Hard Disk, `n Only the Last one will Remain in Memory.
IfMsgBox No
Return
FileDelete, TempClip\*.*
Reload
Return
SwitchStyle:
Menu, BasicClipID, ToggleCheck, Switch to Simple Style
If Style=1
{
Style=0
SoundPlay, Resources\Close Window.mp3
}
else
{
Style=1
SoundPlay, Resources\Close Window.mp3
}
Iniciate := 1
Gosub, Style
Return
CreateMissing:
CountImg := 0
Loop, %CorpusCount%
if !FileExist("HTMLTemp\Image" A_Index ".jpg")
{
Corpus := A_ScriptDir "\HTMLTemp\Corpus" A_Index ".html"
;MsgBox, %Corpus%
Filecopy %Corpus%, CorpusTemp.html
RunWait, %A_WorkingDir%\Addons\wkhtmltoimage.exe --width 640 CorpusTemp.html Image_Temp.jpg,,hide
Gosub, ResizeH
ImageCount1 := "HTMLTemp\Image" A_Index ".jpg"
FileMove, Image_Temp.jpg, %ImageCount1%
FileDelete, CorpusTemp.html
CountImg++
}
If CountImg=0
{
MsgBox, All Clipboard already have Thumbnails.
}
Else
{
MsgBox, Finished process.`n`n %CountImg% Thumbnail(s) has been Created.
}
Return
/*
;Loop, 6
MsgBox, %CorpusCount%
Loop, %CorpusCount%
if !FileExist("HTMLTemp\Image" A_Index ".jpg")
{
MsgBox, No existe Imagen %A_Index%
}
;Else
;{
;MsgBox, Sí existe Imagen %A_Index%
;}
idx = 0
loop, HTMLTemp\Corpus*.html
CorpusCount := % Floor(A_Index)
;MsgBox, %CorpusCount% - %A_Index% - %idx%
Loop, %CorpusCount%
idx++
;MsgBox, %CorpusCount% - %A_Index% - %idx%
;Imagecheck :="HTMLTemp\Image" A_Index ".jpg"
if !FileExist("h:\Download\Script\MultiClipboard Preview 4.1n\HTMLTemp\Image" A_Index ".jpg")
{
MsgBox, No existe Imagen %A_Index% %idx%
}
*/
EditScript:
Run Edit %A_ScriptName%
Return
^!F7::
Reloaded:
Reload
Return
NotifyTrayClick_201:
;xSplash := Floor((A_ScreenWidth/2)-450)
;ySplash := Floor((A_ScreenHeight/2)-200)
xSplash := A_ScreenWidth-506
ySplash := A_ScreenHeight-180
SplashTextOn, 500, 80, Content of the current clipboard, %Clipboard%
WinMove, Content of the current clipboard,, xSplash, ySplash
;SplashTextOn,,, Displays only a title bar.
Sleep, 1000
SplashTextOff
;SplashTextOn,,, %Clipboard%
;WinMove,,, xSplash, ySplash
;Sleep, 1000
;SplashTextOff
Return