Want to earn a free ClipboardFusion Pro license? We're looking for ClipboardFusion translators!
<< Discussions<< NewsReply
Working with Triggers

Triggers are essentially a much more comprehensive version of Text Scrubbing and Text Replace, and as such, it replaces the existing features. ClipboardFusion Beta 5 will import your existing Text Scrubbing and Text Replace rules, so anything you've setup already shouldn't be affected. If you do notice any issues with the imported rules, please let us know. The installer and auto-updater will automatically back up your settings, so if anything bad happens to your Text Scrubbing or Text Replace rules, you can roll back to your last version and restore your settings from before the update.

The Triggers feature adds a bunch of new functionality for automating your workflow:

  • You can now have ClipboardFusion do more than just automatically scrub and replace text. You can also set up Triggers to run when you start or exit ClipboardFusion, when you lock or unlock your computer, change focus to another window, and much more. We're planning to add more events in the future.
  • Triggers have the ability to only run when they match certain conditions, such as matching text on the Clipboard, matching window text and window class, in addition to process, and process command line parameters.
  • Triggers can perform multiple actions, and there are now more actions than Text Scrubbing and Text Replace. You will be able to run Macros, play sounds, show notifications, and fire Hotkeys.

Let's start with an overview of the different fields in the Trigger edit window.

  • Event: Select what event should trigger this rule. For example, the "Trigger Command Received" event will fire when the Trigger command (specified on the Triggers tab or via the ClipboardFusion tray icon) is detected. For example, always, double-copy only, or always except on double-copy.
  • Don't process Triggers after this one if matched: Enabling this checkbox will tell ClipboardFusion to stop processing the rules for this Trigger Event type if this rule is matched. If you have a wildcard (*.*) rule after this rule in the list, you'd want to enable this checkbox if you don't want the *.* rule to also run when this rule is finished.
  • Set Clipboard with the result of this Trigger: Enabling this checkbox will set the current clipboard text to the text that is returned from this Trigger rule. In most cases, you'll want this checkbox enabled. You would disable it if the rule runs a Macro that returns null, or performs actions not directly related to the text on the clipboard (e.g. if your Macro saves the clipboard text to a file).
  • Clipboard Text (optional): Use this Match Condition if you want the Trigger rule to run only when certain clipboard text is on (or not on) the clipboard. There are different match types for this condition (clipboard text contains, doesn't contain, is exactly, etc).
  • Process Filename (optional): You can manually enter the path to the application, or click the "Select Application" button to choose it. This option also accepts wildcards (e.g. C:\Applications\*, or *.*).
  • Process Command Line Parameters (optional): In some cases, you may only want the rule to match if the program is running with specific command line parameters (e.g. if VLC was started with the --repeat parameter). Enter the parameters exactly in this option. You can view them for a running process by adding the "Command Line" column to the Windows Task Manager. You can also auto-populate this field by dragging the target icon and dropping it on the running program window.
  • Window Text (optional): This option will allow you to specify a full or partial window title to match by. You can auto-populate this field by dragging the target icon and dropping it on the window you'd like to grab the title from. This field uses our text query engine, allowing you to specify multiple titles, and exclude certain text as well.
  • Window Class (optional): This option will allow you to specify the window class to match. This is generally useful if you want to move only certain windows of an application (e.g. dialogs, settings windows, etc). You can auto-populate this field by dragging the target icon and dropping it on the window you'd like to grab the class from. This field uses our text query engine, allowing you to specify multiple classes, and exclude certain text as well.
  • Actions: This is where you'll add all of the actions you'd like to perform when the Trigger rule runs. You can scrub text (removes leading and trailing spaces, line breaks, tabs, and formatting), replace parts of the text with new text, set new output text (this will change what text gets sent to actions after this one) and run ClipboardFusion HotKeys and Macros. You can also add a Play Sound or Show Notification action if you want a positive confirmation that the Trigger rule was run.

Examples

Here are a few example Trigger rules. These are fairly basic, but should show the basic concepts of Trigger rules, and from there, you can get more specific with your Match Conditions, add more Actions, or get really crazy with custom scripted Macros. The possibilities are endless!

Simple Text Replace Rule

This rule will replace the word "pizza" with the word "hamburger" in text copied from any program.

  • On the Settings > Triggers tab, click Add > Text Replace.
  • In the Match Text field, enter the text you want to look for, e.g. "pizza".
  • In the Replace Text field, enter the text you want to replace the Match Text with, e.g. "hamburger".
  • Click OK to save the rule, and Apply to save the ClipboardFusion Settings (the rule won't take effect until the main ClipboardFusion Settings have been applied).
Simple Text Replace Rule

Text Replace Rule for a Specific Application

This rule will replace the word "pizza" with the word "hamburger" only in text copied from Notepad.

  • On the Settings > Triggers tab, click Add > Trigger.
  • Enable the "Process Filename" checkbox, and select Notepad using the "Select Application" window that opens. If Notepad isn't currently running, just click Cancel, and type "*Notepad.exe" into the Process Filename textbox.
  • In the Actions pane, click Add > Text Replace.
  • In the Match Text field, enter the text you want to look for, e.g. "pizza".
  • In the Replace Text field, enter the text you want to replace the Match Text with, e.g. "hamburger".
  • Click OK to save the Text Replace Action, then OK to save the Trigger rule, and Apply to save the ClipboardFusion Settings.
Text Replace Rule for Notepad Only

Scrub and Replace then Show Notification

This rule will scrub the whitespace from the beginning and end of text, replace the word "pizza" with "hamburger", then display a notification if any changes to the text were made.

  • On the Settings > Triggers tab, click Add > Trigger.
  • In the Actions pane, click Add > Scrub Text.
  • In the window that pops up, enable the first two options, then click OK.
  • In the Actions pane, click Add > Text Replace.
  • In the Match Text field, enter the text you want to look for, e.g. "pizza".
  • In the Replace Text field, enter the text you want to replace the Match Text with, e.g. "hamburger".
  • Click OK to save the Text Replace Action.
  • In the Actions pane, click Add > Show Notification if Text Changes.
  • Enter "Whitespace trimmed and text replaced", then Click OK.
  • Click OK to save the Trigger rule, and Apply to save the ClipboardFusion Settings.
Scrub Text
Show Notification if Text Changes
Scrub and Replace then Show Notification

Trigger rules are processed in the order that they're shown in each section of the list on the Triggers tab. Each Trigger type is separate from the others, so if a window is focused, only the rules in the Window Focused section will be processed. Tip: If you're using a mix of rules with specific match criteria, and rules with wildcard criteria, it's best to move the wildcard rules to the bottom of the list, so that the more specific rules get processed first.

As always, if you run into any issues, or have any questions or concerns, please don't hesitate to ask!

Jun 4, 2017 (modified 6 days ago)  • #1
Was this helpful?  Login to Vote  Login to Vote
<< Discussions<< NewsReply
Visit ClipboardFusion on FacebookVisit ClipboardFusion on TwitterVisit ClipboardFusion on Google+Visit ClipboardFusion on LinkedInSearch for ClipboardFusion on RedditFollow ClipboardFusion on RSSVisit ClipboardFusion on Instagram
Copyright © 2007-2017 Binary Fortress Software • News • Discussions • FAQ • Support • Privacy • ToS