Editing Clipboard Commands

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 17: Line 17:
 
</pre>
 
</pre>
  
then the press the  '''<*>cmd>''' button and the application will open all 4 url's in your systems default browser.  This lets you keep a list of links in any file that can store text.
+
then the *>cmd button will open all 4 url's.  This lets you keep a list of links in any file that can store text.
 
 
== Manual/Auto ==
 
 
 
* Press the '''*>cmd''' button to interpret the clipped text as a command.
 
* Depress the radio button '''<always on>''' and each new clipboard change will be interpreted as a command, but a general rule is that a command must be found in the first line, so unless this is true the command button acts as if it were not on, the same is true when you press the command button.
 
  
 
= Command Details =  
 
= Command Details =  
  
 
== *>url ==
 
== *>url ==
This command will open a url that follows the *>url.  If multiple lines contain the command many urls will be opened.
 
One restriction is that the first line copied must contain a *>url command.  Following lines in the clipboard that do not contain the command are just ignored.  Most webbrowsers can copy out the titles and urls of an open page or all open tabs.  If this is copied into the clipboard the transform "add *>url" will add the command to each url ( one per line ) found.  The transform can then be save for later use as a command. 
 
 
The code for the command is mostly in cmd_processor.do_star_url_line().
 
 
 
== *>text ==
 
== *>text ==
The *>text command is used to open text files.  The command needs to be followed by the name of a file that can be opened with your system editor ( the key parameter is paremeters.ex_editor see '''[[Configuration Files For Python]]''' )  You can have multiple *>text commands in your clipped content, only lines with *>text will be attempted, other lines will be ignored.  Files are not currently tested to see if they exist, non-existent files may trigger side effects in your editor.  The content returned to the clipboard is all the lines that were identified as *>text lines.  Junk after the file name will be interperted as part of the file name, so leave it out of your file, this goes for spaces as well ( but I probably will fix this.  As with *>url the first line of the copied text must contain a command.
 
 
There is a transform for adding *>text in front of lines of file names.
 
 
The code for the command is mostly in cmd_processor.do_star_text_line
 
 
 
== *>shell ==
 
== *>shell ==
The command *>shell followed by a string your operating system recognizes a command in your os terminal shell will run that string.  Like *>url and *>text it can work for multiple commands across multiple lines.
 
  
My file explorer in windows does a nice job of copying one or multiple file names ( program is called FreeCommander ), the transform
 
  
 
The code for the command is mostly in cmd_processor.do_star_text_line
 
  
 
== *>bat ==
 
== *>bat ==
The *>bat command allows you to execute windows dos batch commands from text stored anywhere you can copy from.  These commands are inherently multilined.  For example:
 
 
  
*>bat
 
        dir c:
 
*>end
 
 
   
 
   
The above command will fill the clipboard with the result from the directory of c:
 
  
Because the command is multilined it needs some sort of end marker.  This is '''*>end'''
 
  
== *>py ==
+
 
 
Not implemented, planed to be like *>bat but for Python code.
 
 
 
= Customization =
 
  
Writing your own Commands is more complicated than I want to document now.  Code is in cmd_processor.py
 
  
  
 
[[Category:ClipBoard]]  [[category:Python]]  [[category:Python Projects]]
 
[[Category:ClipBoard]]  [[category:Python]]  [[category:Python Projects]]

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)