A Gradle project for Groovy users who need utility code to copy text strings to/from system clipboards. Clone includes gradle build tool wrapper and folder structure like maven/gradle so you don’t need an installed gradle build tool.
-
Working internet connection
-
Installed Git client to copy/clone this repo
-
Ability to use terminal console
-
Open terminal console
-
Change directory \( cd \) into target folder location
-
Run this command to create a folder and copy down all the pieces :
git clone https://github.com/jnorthr/CopyTools.git
-
cd CopyTools/
-
./gradlew runs defined tasks to build and test code samples
-
After prior step completes, examine CopyTools/ folder to find the /build/ folder with test results
The Copier.groovy source has methods to interact with the System Clipboard of most O/S types.
public void copy(String s)
This is a class method to do the deed. Call this method with a Java/Groovy or JVM language String types to place that string on to the System Clipboard of the operating system. Only String copies are supported.
Copier ck = new Copier(); ck.copy("Hi from me");
public String paste()
This is a class method to do the deed. Call this method with a Java/Groovy or JVM language to receive a String type from System Clipboard of the operating system. Only String copies are supported.
Copier ck = new Copier(); def what = ck.paste();