<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>pnotepad.org forums &#187; Tag: script - Recent Topics</title>
		<link>http://pnotepad.org/forums/tags/script</link>
		<description>Programmer&#039;s Notepad Forums</description>
		<language>en-US</language>
		<pubDate>Thu, 09 Feb 2012 12:06:47 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://pnotepad.org/forums/search.php</link>
		</textInput>
		<atom:link href="http://pnotepad.org/forums/rss/tags/script/topics" rel="self" type="application/rss+xml" />

		<item>
                        <title>auto-indent Python code (bhengh)</title>
			<link>http://pnotepad.org/forums/topic/5441#post-8288</link>
			<pubDate>Thu, 01 Sep 2011 18:44:01 +0000</pubDate>
			<dc:creator>bhengh</dc:creator>
			<guid isPermaLink="false">8288@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I would like to use Programmer's Notepad to write Python apps.  Is there anyway to get Programmer's Notepad to auto-indent after a block statement?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>PyPN - Defects and Enhancement requests (CoDEmanX)</title>
			<link>http://pnotepad.org/forums/topic/5267#post-7955</link>
			<pubDate>Fri, 27 May 2011 14:05:32 +0000</pubDate>
			<dc:creator>CoDEmanX</dc:creator>
			<guid isPermaLink="false">7955@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;(This is meant as a collective thread)&#60;/p&#62;
&#60;ul&#62;
&#60;li&#62;&#60;strong&#62;GetCharAt returns an int instead of a character&#60;/strong&#62;&#60;br /&#62;
&#60;code&#62;GetCharAt(self, pos) : int 	Get the character at the given position.&#60;/code&#62;&#60;br /&#62;
The PyPN API doc is right, it returns a number, which is basically what you pass to it (pos). Doesn't make much sense, it should return the character - shouldn't it?&#60;/p&#62;
&#60;p&#62;Workaround: GetTextRange(pos, pos+1)&#60;/li&#62;
&#60;li&#62;&#60;strong&#62;Stock PyPN textclip contain bad indentation&#60;/strong&#62;&#60;br /&#62;
PyPN Script File and PyPN Script Method got 4 leading spaces here:&#60;br /&#62;
&#60;code&#62;${0:pass}&#60;/code&#62;&#60;br /&#62;
The above comment line uses tab indent, leading to indentation error.&#60;/p&#62;
&#60;p&#62;Moreover, the $0 placeholder of PyPN Undo Block is at the beginning of the line, followed by a tab. Either the tab is too much or $0 should be behind it.
&#60;/li&#62;
&#60;li&#62;&#60;strong&#62;PyPN in textclip - problems with line endings and indentation&#60;/strong&#62;&#60;br /&#62;
PyPN code only works in textclips, if you set line endings of your document to Unix (LF) &#60;a href=&#34;http://code.google.com/p/pnotepad/issues/detail?id=1339&#38;amp;sort=-id&#34;&#62;issue #1339&#60;/a&#62;&#60;br /&#62;
Multi-line PyPN script in textclip doesn't work if you insert it in a line with leading whitespace via shortcut &#60;a href=&#34;http://code.google.com/p/pnotepad/issues/detail?id=1346&#38;amp;sort=-id&#34;&#62;issue #1346&#60;/a&#62;
&#60;/li&#62;
&#60;li&#62;Unfortunately, it's not possibly to combine &#60;strong&#62;PyPN in textclip and the placeholder&#60;/strong&#62; system. It would be quite useful tho. &#60;a href=&#34;http://code.google.com/p/pnotepad/issues/detail?id=1345&#38;amp;sort=-id&#34;&#62;issue #1345&#60;/a&#62;
&#60;/li&#62;
&#60;/ul&#62;</description>
		</item>
		<item>
                        <title>How to run script or bind key to script (cncsnw)</title>
			<link>http://pnotepad.org/forums/topic/5175#post-7675</link>
			<pubDate>Tue, 15 Feb 2011 23:36:21 +0000</pubDate>
			<dc:creator>cncsnw</dc:creator>
			<guid isPermaLink="false">7675@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I have PN 2.2.0.2240 and PyPN 0.10 installed.&#60;/p&#62;
&#60;p&#62;The &#34;Record Script&#34; and &#34;Stop Recording&#34; options are enabled and produce the script in an &#34;untitled&#34; window.  I can save the contents of that window as &#34;somescript.py&#34;.&#60;/p&#62;
&#60;p&#62;How do I play back a recorded script?&#60;/p&#62;
&#60;p&#62;How do I bind a key to a recorded/saved script?&#60;/p&#62;
&#60;p&#62;There must be something simple and obvious I am overlooking....
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>New Script: Jump To... (Patabugen)</title>
			<link>http://pnotepad.org/forums/topic/5142#post-7576</link>
			<pubDate>Mon, 17 Jan 2011 21:14:36 +0000</pubDate>
			<dc:creator>Patabugen</dc:creator>
			<guid isPermaLink="false">7576@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hey,&#60;/p&#62;
&#60;p&#62;One of the features I learned to take for granted in some other editors is a Jump To File dialog, where you can enter a partial filename (such as myfile*) and be presented with a list of files found within your working directory.&#60;/p&#62;
&#60;p&#62;I have written something in PyPN to offer some of this functionality. This is my first go at Python so any feedback on, or improvements to, the code are very welcome.&#60;/p&#62;
&#60;p&#62;Rather than going into the world of GUI's I have made use of a new document within PN to display the output, I'd be interested to know how well this works for you on your systems.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://scriptshare.rocketmonkeys.com/script/30&#34; rel=&#34;nofollow&#34;&#62;http://scriptshare.rocketmonkeys.com/script/30&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If you want suggestions for keyboard shortcuts to bind this to Netbeans uses Alt + Shift + O (for Open) and Eclipse uses Ctrl + Shift + R (for Resource). Personally I use Alt + Shift + A because it's handy.&#60;/p&#62;
&#60;p&#62;--&#60;br /&#62;
Patabugen&#60;/p&#62;
&#60;p&#62;p.s I realise this is a feature planned for PN in the future, this is intended as an interim measure.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Operating on a rectangular selection (Nux)</title>
			<link>http://pnotepad.org/forums/topic/5114#post-7490</link>
			<pubDate>Sun, 05 Dec 2010 23:58:39 +0000</pubDate>
			<dc:creator>Nux</dc:creator>
			<guid isPermaLink="false">7490@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi. I'm just wondering if it is possible to know that the selected block is a rectangular selection and how to make operations on this selection? What I would need is at least an information at which line does the selection starts and ends and probably column numbers... Or maybe simply dimensions and a starting position... But some kind of access to a collection of lines in this selection would be wonderful.&#60;/p&#62;
&#60;p&#62;I'm asking because I want to do a script that would add tags around each selected line of code in this block. Picture for example a space indented table to which you want to add an extra cell in each row or add links inside this cells...&#60;/p&#62;
&#60;p&#62;BTW. I just discovered something amazing :-). When I select few lines of code with ALT pressed I can write on few lines of code at once and even delete characters on each of these lines. This is great :D!
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How to use ISearchOptions in PyPN-Script? (CoDEmanX)</title>
			<link>http://pnotepad.org/forums/topic/5077#post-7401</link>
			<pubDate>Mon, 04 Oct 2010 22:43:11 +0000</pubDate>
			<dc:creator>CoDEmanX</dc:creator>
			<guid isPermaLink="false">7401@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi simon,&#60;br /&#62;
i wrote a little python script to format some c-like code, which has all whitespace removed. Before i run it, i have to replace all appearences of:&#60;/p&#62;
&#60;p&#62;\{ &#60;strong&#62; --&#38;gt; &#60;/strong&#62; \r\n{\r\n &#60;em&#62;(add line break before and after left brace)&#60;/em&#62;&#60;br /&#62;
\} &#60;strong&#62; --&#38;gt; &#60;/strong&#62; \r\n}\r\n &#60;em&#62;(same for right brace)&#60;/em&#62;&#60;br /&#62;
; &#60;strong&#62; --&#38;gt; &#60;/strong&#62; ;\r\n &#60;em&#62;(line break after semicolon)&#60;/em&#62;&#60;br /&#62;
(for[ ]*\([ ]*[^;]+;)\r\n([^;]+;)\r\n([^)]+\)) &#60;strong&#62; --&#38;gt; &#60;/strong&#62; \1 \2 \3\r\n &#60;em&#62;(repair for-loops, they contain semicolons)&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;these regular expressions add the missing line breaks&#60;/p&#62;
&#60;p&#62;then i use my python script to add indentation:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;import pn
import string
import scintilla
from pypn.decorators import script

@script(&#38;quot;Indent (C++)&#38;quot;, &#38;quot;Script&#38;quot;)
def IndentCpp():
    editor = scintilla.Scintilla(pn.CurrentDoc())

    indentLevel = 0
    tab_width = 4
    left_brace_cur_line = False
    end = editor.Length

    editor.BeginUndoAction()

    for l in range(editor.LineCount):
        line = editor.GetLine(l)
        a = 0
        while True:
            if (a &#38;gt;= len(line)):
                if (left_brace_cur_line):
                    if (indentLevel &#38;gt; 0):
                        editor.SetLineIndentation(l,(indentLevel-1)*tab_width)
                else:
                    editor.SetLineIndentation(l,indentLevel*tab_width)
                left_brace_cur_line = False
                break
            if (line[a] == &#38;quot;{&#38;quot;):
                indentLevel = indentLevel + 1
                left_brace_cur_line = True
            elif (line[a] == &#38;quot;}&#38;quot; and indentLevel &#38;gt; 0):
                indentLevel = indentLevel - 1
            a = a + 1

    editor.EndUndoAction()&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I'd like to automate the regex stuff, but there's no replace/replaceall function python. I found IDocument.ReplaceAll and ISearchOptions.* in the PyPN API documentation but i don't know how to use the search options.&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;p = pn.CurrentDoc()&#60;br /&#62;
p.ISearchOptions ???&#60;/strong&#62;&#60;/p&#62;
&#60;p&#62;can you tell me how use it properly or tell me another way to this task?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Hello, love the new script recorder! (Jan)</title>
			<link>http://pnotepad.org/forums/topic/583#post-2062</link>
			<pubDate>Sun, 17 May 2009 00:26:39 +0000</pubDate>
			<dc:creator>Jan</dc:creator>
			<guid isPermaLink="false">2062@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Title pretty much says it all. The script recorder makes it much, much easier for beginners to learn scripting. An excellent addition!
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>PyPN Script UnderScoreToPascalCase (ToddFiske)</title>
			<link>http://pnotepad.org/forums/topic/547#post-1886</link>
			<pubDate>Fri, 27 Feb 2009 22:00:58 +0000</pubDate>
			<dc:creator>ToddFiske</dc:creator>
			<guid isPermaLink="false">1886@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I have written my first script to contribute to the Programmer's Notepad community. It converts all identifiers in a file that are in under_score format into PascalCase format.&#60;/p&#62;
&#60;p&#62;This was a great project to help me learn more about Programmer's Notepad and scripting the editor and the Scintilla interface with Python. I used the TabsToSpaces script as a starting point, and used the API listing script and the Scintilla documentation to help figure out functions and parameters. &#60;/p&#62;
&#60;p&#62;I look forward to writing more scripts and integrating PNotepad more into my daily work. Thank you Simon for putting together such a great little editor!&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;# PascalCase.py
# convert identifiers from under_score to PascalCase format
# Todd Fiske
# 2009-02-27 15:46:58

import pn
import scintilla
import string
from pypn.decorators import script

#---

# helper functions

def SetTarget(e, x, y):
    e.TargetStart = x
    e.TargetEnd = y

def Say(s):
    pn.AddOutput(s + &#38;amp;quot;\n&#38;amp;quot;)

def USToPC(s):
    # replace underscores with spaces, title case, replace spaces with no char
    return s.replace(&#38;amp;quot;_&#38;amp;quot;, &#38;amp;quot; &#38;amp;quot;).title().replace(&#38;amp;quot; &#38;amp;quot;, &#38;amp;quot;&#38;amp;quot;)

#---

@script(&#38;amp;quot;under_score to PascalCase&#38;amp;quot;, &#38;amp;quot;Text&#38;amp;quot;)
def UnderScoreToPascalCase():
    Say(&#38;amp;quot;----------&#38;amp;quot;)
    Say(&#38;amp;quot;UnderScoreToPascalCase&#38;amp;quot;)
    editor = scintilla.Scintilla(pn.CurrentDoc())

    start = 0
    end   = editor.Length

    FindRegExp = 2097152
    UnderScoreRegEx = &#38;amp;quot;[a-z]+_[a-z_]+&#38;amp;quot;

    SetTarget(editor, start, end)
    editor.SearchFlags = 0
    editor.SearchFlags = FindRegExp
    editor.BeginUndoAction()

    pos = editor.SearchInTarget(len(UnderScoreRegEx), UnderScoreRegEx)

    while (start &#38;lt; end) and (pos &#38;gt; 0):
        sUnderScore = editor.GetTextRange(editor.TargetStart, editor.TargetEnd)
        sPascalCase = USToPC(sUnderScore)

        Say(&#38;amp;quot;  %d: %s -&#38;gt; %s&#38;amp;quot; % (editor.TargetStart, sUnderScore, sPascalCase))
        editor.ReplaceTarget(-1, sPascalCase)

        start = editor.TargetEnd + 2
        end   = editor.Length

        if start &#38;lt; end:
            SetTarget(editor, start, end)
            pos = editor.SearchInTarget(len(UnderScoreRegEx), UnderScoreRegEx)

    editor.EndUndoAction()
    Say(&#38;amp;quot;done&#38;amp;quot;)

###&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
                        <title>Feature request: Better script management (kuukkeli)</title>
			<link>http://pnotepad.org/forums/topic/428#post-1511</link>
			<pubDate>Thu, 26 Jun 2008 06:23:35 +0000</pubDate>
			<dc:creator>kuukkeli</dc:creator>
			<guid isPermaLink="false">1511@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Currently all scripts within scripts folder are listed when PN starts. Even with quite few scripts this leads to cluttered script window and forces the user to fold away some of the script groups every time PN is started. I'm making few suggestions that in my opinion would be improvements and that could be implemented either separately or en masse.&#60;/p&#62;
&#60;p&#62;1. Make PN remember which script groups were folded.&#60;/p&#62;
&#60;p&#62;2. Make an option to start PN with all script groups folded.&#60;/p&#62;
&#60;p&#62;3. Make a context menu for script window that allows user to tick script groups on and off for good (maybe some sort of &#34;blacklist&#34; is kept as a file and if script's group matches an entry there it's not loaded). This probably needs quite a bit of work but with #1 it would be in my opinion an ideal solution.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>PyPN Documentation (dandersahn)</title>
			<link>http://pnotepad.org/forums/topic/214#post-777</link>
			<pubDate>Fri, 27 Apr 2007 20:24:02 +0000</pubDate>
			<dc:creator>dandersahn</dc:creator>
			<guid isPermaLink="false">777@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Is there any documentation out there for PyPN?  Some things that worked in older versions don't seem to work in the latest (0.5).  I'm trying to figure out the correct function call to get the current document name, for example.  pn.CurrentDoc().GetFileName() used to work, but doesn't seem to any more.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Script Development (macdonag)</title>
			<link>http://pnotepad.org/forums/topic/353#post-1245</link>
			<pubDate>Wed, 12 Mar 2008 14:01:51 +0000</pubDate>
			<dc:creator>macdonag</dc:creator>
			<guid isPermaLink="false">1245@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I just noticed the script functionality - looks very powerful, I'm beginning to play with it now.  A couple of things would be good though:&#60;br /&#62;
 - Any chance of including the scripting in the default installer?  It would be used a lot more in that case, I believe.&#60;br /&#62;
 - Any chance of the script system looking for changes to the script directory and it's files?  Currently, if I add a new file or a new function, I have to restart pn to add it to the Scripts window.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
graham
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>what is the &#34;scripts&#34; tab for? (sagedavis)</title>
			<link>http://pnotepad.org/forums/topic/351#post-1238</link>
			<pubDate>Tue, 11 Mar 2008 21:18:04 +0000</pubDate>
			<dc:creator>sagedavis</dc:creator>
			<guid isPermaLink="false">1238@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;this is a weird question.&#60;br /&#62;
I have this tab called &#34;scripts&#34;, it's blank, and I can't paste anything into it. What is it for? is it something that is being developed or am I just not sure how to use it yet?&#60;br /&#62;
Thanks in advance&#60;br /&#62;
Sage
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Script: Character Info (wvdirks)</title>
			<link>http://pnotepad.org/forums/topic/352#post-1239</link>
			<pubDate>Wed, 12 Mar 2008 06:48:35 +0000</pubDate>
			<dc:creator>wvdirks</dc:creator>
			<guid isPermaLink="false">1239@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I finally took some time, taught myself a bit of Python, and wrote a script for PN2 that I think is useful. It takes the selected character in the current document and spits out some info about it like ANSI (cp1252) value, Unicode value, Unicode name, UTF8 and UTF16LE representation. &#60;/p&#62;
&#60;p&#62;For instance the output for ù is something like this:&#60;/p&#62;
&#60;p&#62;=== Character Info ===&#60;br /&#62;
ANSI: 249&#60;br /&#62;
Unicode: U+00F9&#60;br /&#62;
NFD: U+0075,U+0300&#60;br /&#62;
Name: LATIN SMALL LETTER U WITH GRAVE&#60;br /&#62;
UTF8: xc3,xb9&#60;br /&#62;
UTF16LE: xf9,x0&#60;/p&#62;
&#60;pre&#62;

import unicodedata
import codecs

@script(&#34;CharInfo&#34;, &#34;Text&#34;)
def CharInfo():

  usage = &#34;No character selected&#34;
  editor = scintilla.Scintilla(pn.CurrentDoc())
  char = editor.GetText(editor.SelectionStart, editor.SelectionEnd)

  pn.AddOutput(chr(13) + '=== Character Info ===' + chr(13))
  if len(char) &#38;gt; 0: #first byte
    c1 = ord(char[0])
    u = c1
  if len(char) &#38;gt; 1: #second byte
    c2 = ord(char[1])
    u = (c1-192)*64+c2-128
  if len(char) &#38;gt; 2: #third byte
    c3 = ord(char[2])
    u = (c1-224)*4096+(c2-128)*64+c3-128
  if len(char) &#38;gt; 3: #fourth byte
    c4 = ord(char[3])
    u = (c1-240)*262144+(c2-128)*4096+(c3-128)*64+c4-128
  try:
    unichar = unichr(u)
    if c1 == ord(unichar): #single byte, check if it's ANSI?
      ansistr = str(ord(unichar))
      unichar = chr(c1)
      test = unichar.decode('cp1252') # convert ANSI to Unicode
      u = ord(test)
    else: #single byte and it's UTF8
      try:
        ansistr = str(ord(unichar.encode('cp1252'))) #calculate ANSI value if possible
      except UnicodeError:
        ansistr = 'none' #there is no ANSI equivalent

    pn.AddOutput('ANSI: ' + ansistr + chr(13))
    pn.AddOutput('Unicode: ' + 'U+' + hex(u).lstrip('0x').zfill(4).upper() + chr(13))
    nfdlist = unicodedata.decomposition(unichr(u)).rsplit(' ')
    if len(nfdlist) &#38;gt; 1:
      pn.AddOutput('NFD: '+','.join('U+'+c for c in nfdlist) + chr(13))
    pn.AddOutput('Name: '+unicodedata.name(unichr(u),'unknown') + chr(13))
    utf8str = &#34;,&#34;.join(hex(ord(c)).lstrip('0') for c in unichr(u).encode('utf_8'))
    utf16lestr = &#34;,&#34;.join(hex(ord(c)).lstrip('0') for c in unichr(u).encode('utf_16_le'))
    pn.AddOutput('UTF8: '+utf8str + chr(13))
    pn.AddOutput('UTF16LE: '+utf16lestr + chr(13))
  except ValueError:
    pn.AddOutput(usage)&#60;/pre&#62;
&#60;p&#62;BTW, I couldn't get the code tag to preserve the indents on this forum. I used pre and it worked OK.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>PN2 is best! (TPAKTOPA)</title>
			<link>http://pnotepad.org/forums/topic/279#post-1001</link>
			<pubDate>Mon, 17 Sep 2007 12:06:13 +0000</pubDate>
			<dc:creator>TPAKTOPA</dc:creator>
			<guid isPermaLink="false">1001@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;First THANKS for such a great program ! I found more and more new functionality in it almost each day !&#60;/p&#62;
&#60;p&#62; Question: How can I automate formating ( or to be more specific, &#34;multi replace&#34;)&#60;br /&#62;
Like&#60;br /&#62;
{ &#34; select * \r\n from basics \r\n where a=b&#34; }&#60;/p&#62;
&#60;p&#62;to be&#60;br /&#62;
 select *&#60;br /&#62;
 from basics&#60;br /&#62;
 where a=b&#60;/p&#62;
&#60;p&#62;I do this more than hundred times, while debuging ... What should I do best ? a plug-in DLL for patterns , or what ?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Script: fillDown (mirkosoft)</title>
			<link>http://pnotepad.org/forums/topic/270#post-962</link>
			<pubDate>Wed, 08 Aug 2007 14:28:22 +0000</pubDate>
			<dc:creator>mirkosoft</dc:creator>
			<guid isPermaLink="false">962@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;The following script tries to provide a fillDown function:&#60;br /&#62;
In a rectangular, multi line selection insert the selected text on the first line in front of the selections of the subsequent lines. Any improvements are highly appreciated!&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;import pn
import scintilla
import string
from pypn.decorators import script

@script(&#38;quot;FillDown&#38;quot;, &#38;quot;MyScripts&#38;quot;)
def fillDown():
	editor = scintilla.Scintilla(pn.CurrentDoc())
	editor.BeginUndoAction()

	if editor.SelectionIsRectangle:

		posStart = editor.SelectionStart
		posEnd = editor.SelectionEnd
		firstLine = editor.LineFromPosition(posStart)
		lastLine = editor.LineFromPosition(posEnd)

		text = editor.GetText(editor.GetLineSelStartPosition(firstLine),
          editor.GetLineSelEndPosition(firstLine))

		corr = 0
		if editor.CurrentPos != posStart:
			corr = len(str(text))

		editor.GotoPos(posStart)

		for i in range(firstLine, lastLine):
			editor.LineDown()
			editor.GotoPos(editor.CurrentPos - corr)
			editor.AddText(len(str(text)), str(text))

	else:
		pn.AddOutput(&#38;quot;no rectangular selection found&#38;quot;)

	editor.EndUndoAction()&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
                        <title>path of current document (mirkosoft)</title>
			<link>http://pnotepad.org/forums/topic/267#post-949</link>
			<pubDate>Tue, 07 Aug 2007 06:53:21 +0000</pubDate>
			<dc:creator>mirkosoft</dc:creator>
			<guid isPermaLink="false">949@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Is there a way to get the path of the current document in a script?&#60;br /&#62;
I know, we can get the filename of the current document as 'pn.CurrentDoc().FileName'.&#60;/p&#62;
&#60;p&#62;I'm trying to write a script, that makes it possible to reload (or reopen) the current document and can be assigned to some hotkey. Any ideas on this?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>feature req: Inverting Case (AlexRayne)</title>
			<link>http://pnotepad.org/forums/topic/232#post-850</link>
			<pubDate>Mon, 28 May 2007 14:46:19 +0000</pubDate>
			<dc:creator>AlexRayne</dc:creator>
			<guid isPermaLink="false">850@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hallow developers!&#60;br /&#62;
PN now able to Set an Lower or Upper Case of selected text. i`ve needed an inverting Case of typed text, IMHO such ability need for completeness.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>PyPN - Sort Lines (wischeese)</title>
			<link>http://pnotepad.org/forums/topic/243#post-869</link>
			<pubDate>Wed, 20 Jun 2007 17:51:19 +0000</pubDate>
			<dc:creator>wischeese</dc:creator>
			<guid isPermaLink="false">869@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;This is my first python script.  It should sort the current selection.  Any pointers on improving it are greatly appreciated.  Also any pointers on developing these scripts?  Right now I'm restarting PN after each change to force it to reload.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Scott&#60;/p&#62;
&#60;p&#62;import pn&#60;br /&#62;
import scintilla&#60;br /&#62;
import string&#60;br /&#62;
from pypn.decorators import script&#60;/p&#62;
&#60;p&#62;@script(&#34;Sort Lines&#34;)&#60;br /&#62;
def SortLines():&#60;br /&#62;
  editor = scintilla.Scintilla(pn.CurrentDoc())&#60;br /&#62;
  editor.BeginUndoAction()&#60;/p&#62;
&#60;p&#62;  lsSelection = editor.GetText(editor.SelectionStart, editor.SelectionEnd)&#60;br /&#62;
  laLines = lsSelection.splitlines(0)&#60;br /&#62;
  laLines.sort()&#60;br /&#62;
  lsReplace = string.join(laLines, '\r\n' )&#60;/p&#62;
&#60;p&#62;  #pn.AddOutput(text + '\r\n')&#60;br /&#62;
  #pn.AddOutput('Lines\r\n')&#60;br /&#62;
  #pn.AddOutput(str(lines))&#60;/p&#62;
&#60;p&#62;  editor.ReplaceSel(lsReplace)&#60;br /&#62;
  editor.EndUndoAction()
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Run the current buffer as a python script (mirkosoft)</title>
			<link>http://pnotepad.org/forums/topic/253#post-909</link>
			<pubDate>Tue, 17 Jul 2007 14:28:59 +0000</pubDate>
			<dc:creator>mirkosoft</dc:creator>
			<guid isPermaLink="false">909@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi&#60;/p&#62;
&#60;p&#62;First, thank you very much for building my text editor of choice!&#60;/p&#62;
&#60;p&#62;I'd really like to be able to run the current buffer as a python script, possibly by simply hitting F8 or some other nice key. This should run the current buffer as a pn script, without adding it to the script view. I have tried to accomplish this by adding python.exe as a new tool - which throws ImportError: No module named pn. &#60;/p&#62;
&#60;p&#62;Would be nice, if you could build this into one of the next releases...
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>scripts? (miechu)</title>
			<link>http://pnotepad.org/forums/topic/189#post-671</link>
			<pubDate>Tue, 27 Mar 2007 11:06:56 +0000</pubDate>
			<dc:creator>miechu</dc:creator>
			<guid isPermaLink="false">671@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;hi, i'm using latest beta...&#60;/p&#62;
&#60;p&#62;i noticed this window called &#34;scripts&#34; and my questio is: what is it for? like... do you plan to implement it later or can i use it somehow?&#60;/p&#62;
&#60;p&#62;and some feature requests:&#60;/p&#62;
&#60;p&#62;- auto format html doc - could be a script or something (if you'd support perl i could write one :p)&#60;br /&#62;
- change the schema name form Hypertext to HTML - it's more intuitive&#60;br /&#62;
- configurable font for autocomplete&#60;br /&#62;
- docking windows would be cool&#60;br /&#62;
- maybe some attaching doc/man? - like in PerlIDE
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>PyPN (mk)</title>
			<link>http://pnotepad.org/forums/topic/148#post-547</link>
			<pubDate>Mon, 18 Dec 2006 11:51:39 +0000</pubDate>
			<dc:creator>mk</dc:creator>
			<guid isPermaLink="false">547@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I do like programmers notepad and want to use its scripting capabilities using Python. From the documentation I found, some questions left. So I didn't find information about:&#60;br /&#62;
(i) using documents (opening windows, creating new documents, closing and all the flow)&#60;br /&#62;
(ii) creating an input form/box for getting user input/data.&#60;/p&#62;
&#60;p&#62;Thanks in advance for Your help,&#60;br /&#62;
Michael
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>

