'CLEAR
QuickClip("")
'SET
QuickClip("Hello World!")
'GET
Result = QuickClip(Null)
'==========================================================================================
'------------------------------------------------------------------------------------------
Function QuickClip(input)
If IsNull(input) Then
QuickClip = CreateObject("HTMLFile").parentWindow.clipboardData.getData("Text")
If IsNull(QuickClip) Or IsEmpty(QuickClip) Then
QuickClip = ""
End If
Else
CreateObject("WScript.Shell").Run _
"mshta javascript:eval(""document.parentWindow.clipboardData.setData('text','" _
& Replace(Replace(input, "'", "\\u0027"), """", "\\u0022") & "');window.close()"")", _
0,True
End If
End Function
'------------------------------------------------------------------------------------------
'==========================================================================================
Function QuickClip(input)
'@desc
' A quick way to set and get your clipboard.
'@params
' input [string/null] - Null is used to get clipboard, a string is used to set it.
'@return
' [string] - The contents of your clipboard as a string.
'@author
' Jeremy England, simplycoded.help@gmail.com
If IsNull(input) Then
QuickClip = CreateObject("HTMLFile").parentWindow.clipboardData.getData("Text")
If IsNull(QuickClip) Or IsEmpty(QuickClip) Then
QuickClip = ""
End If
Else
CreateObject("WScript.Shell").Run _
"mshta javascript:eval(""document.parentWindow.clipboardData.setData('text','" _
& Replace(Replace(input, "'", "\\u0027"), """", "\\u0022") & "');window.close()"")", _
0,True
End If
End Function