Title

Message

Confirm

Want to earn a free ClipboardFusion Pro license? We're looking for ClipboardFusion translators!
<< DiscussionsReply

Use regex to determine next step

Avatar from Gravatar.com
Leon André Bergman
57 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.
14 days ago  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
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!
14 days ago  • #2
Avatar from Gravatar.com
Leon André Bergman
57 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?
13 days ago  • #3
Avatar from Gravatar.com
Leon André Bergman
57 discussion posts
I added a BFS.Clipboard.Clear(); right before I copied from the field. seems to have worked.
12 days ago  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah yep, good call!
12 days ago  • #5
Was this helpful?  Login to Vote(1)  Login to Vote
<< DiscussionsReply