Leon André Bergman 60 discussion posts
|
So I am trying to expand my macros to skip some steps that are not always necessary. so I am checking a text field to see if text exists. If it does, several steps can be skipped, and if it doesn't some steps need to be taken.
Right now I'm fetching the text from the field using text = BFS.Clipboard.CopyText(); This works without issues. Then I try to set up an if/else statement, if (text.Contains("")) How can I get this to check if there is text or not? I know how to make it look for certain text, but not any text, or no text. May 20, 2020
• #1
|
|
There's a function that checks if there is text on the clipboard,
BFS.Clipboard.HasText, so you can do this: if (BFS.Clipboard.HasText()) Hope that helps! May 20, 2020
• #2
|
Leon André Bergman 60 discussion posts
|
Thank you. I will try that. But will this not pick up that there is text from before I started the macro? I should probably clear the clipboard first?
May 22, 2020
• #3
|
Leon André Bergman 60 discussion posts
|
I added a BFS.Clipboard.Clear(); right before I copied from the field. seems to have worked.
May 22, 2020
• #4
|
|
Ah yep, good call!
May 22, 2020
• #5
|
Was this helpful? (1) | |