Forum Discussion
Jackson_L
12 years agoContributor
Hello Ofer,
I'm so use to VBScript/JScript I was coding in that. I see you're probably using C# script or the like. Did some reading and looks like you can use GetVarType() to determine the variant type.
http://support.smartbear.com/viewarticle/12102/
eg.
function Test()
{
// Storing and getting an image
//Sys["Clipboard"] = Sys["Process"]("notepad")["Window"]("Notepad", "Untitled - Notepad", 0)["Picture"]();
// Storing and getting text
Sys["Clipboard"] = Sys["Process"]("notepad")["Window"]("Notepad", "Untitled - Notepad", 0)["WndCaption"];
TypeID = GetVarType(Sys["Clipboard"]);
Log["Message"]("Type: " + TypeID);
if (TypeID == varOleStr)
{
Log.Message("A string is held in the clipboard");
}
else
{
Log.Message("A picture is held in the clipboard");
}
}
Cheers,
Jackson
I'm so use to VBScript/JScript I was coding in that. I see you're probably using C# script or the like. Did some reading and looks like you can use GetVarType() to determine the variant type.
http://support.smartbear.com/viewarticle/12102/
eg.
function Test()
{
// Storing and getting an image
//Sys["Clipboard"] = Sys["Process"]("notepad")["Window"]("Notepad", "Untitled - Notepad", 0)["Picture"]();
// Storing and getting text
Sys["Clipboard"] = Sys["Process"]("notepad")["Window"]("Notepad", "Untitled - Notepad", 0)["WndCaption"];
TypeID = GetVarType(Sys["Clipboard"]);
Log["Message"]("Type: " + TypeID);
if (TypeID == varOleStr)
{
Log.Message("A string is held in the clipboard");
}
else
{
Log.Message("A picture is held in the clipboard");
}
}
Cheers,
Jackson
Related Content
- 10 years agolsainsbury
Recent Discussions
- 3 hours agoJacobjacob44