Topics - ewemoa [ switch to compact view ]

Pages: prev1 ... 19 20 21 22 23 [24] 25 26 27next
116
I found the QuickRestart add-on to be helpful while working on assignments:

https://addons.mozilla.org/en-US/firefox/addon/3559

May be if other folks use specific add-ons or other things to aid in their development process, they wouldn't mind sharing the info ;)

117
I've been looking for an easy way [1] to create ActiveX objects so that FScript JScript plugins can get access to more functionality.  I haven't found a good way yet, but one thing that looks promising is hinted at in the section titled "Creating a COM component" in the following (plus perhaps using something like py2exe or cx_Freeze):

  http://stormcoders.blogspot.com/2005/07/taking-advantage-of-com-with-python.html

I haven't manage to get it working yet (not sure what I'm doing wrong), but I'm wondering if anyone else has tried anything similar or has a better idea.

Any thoughts?


[1] Preferably doable w/ free tools, no nasty license agreements to accept, straight-forward to code, etc.

118
Clipboard Help+Spell / Modify Format/Case: Secure Wikipedia URL
« on: February 12, 2009, 12:41 AM »
I convert some of my http Wikipedia URLs to https WikiMedia URLs using CHS' Modify Format/Case functionality, changing things like:

http://en.wikipedia.org/wiki/Magnetite

to:

https://secure.wikimedia.org/wikipedia/en/wiki/Magnetite

In my ClipboardHelpAndSpell\PresetFormats\ directory I have a filed named "SecureWikipedia.preset.format", that contains:

[FormattingForm.rsPropSaver1]
acCheckGroupBoxAddEntire.Checked="false"
AddPrefixEdit.Text=
AddStuffCheckGroupBox.Checked="false"
AddSuffixEdit.Text=
ApplyCheckGroupBox.Checked="true"
ChangeCaseCheckGroupBox.Checked="false"
CheckBoxAddToBlanks.Checked="false"
CheckBoxEvenBetween.Checked="false"
CheckBoxFixedFont.Checked="false"
CheckBoxIndent.Checked="false"
CheckBoxJustify.Checked="false"
CheckBoxNewlineSentences.Checked="false"
CheckBoxNoSpacesInTrimLines.Checked="false"
CheckBoxPostAfterPrefix.Checked="true"
CheckBoxRemoveLinebreaks.Checked="false"
CheckBoxSearchCaseInsensitive.Checked="true"
CheckBoxSearchRegEx.Checked="true"
CheckBoxTrimExcessBlankLines.Checked="true"
CheckBoxTrimExcessWhitespace.Checked="true"
CheckBoxWordWrap.Checked="false"
CheckGroupBoxTrimLeft.Checked="true"
CheckGroupBoxTrimRight.Checked="true"
FindEdit.Text="^http:\/\/([a-zA-Z]+)\.wikipedia\.org\/wiki\/(.*)$"
LabeledEditEntirePrefix.Text=
LabeledEditEntireSuffix.Text=
LeadingCheckGroupBox.Checked="false"
NumberEditWidth.Value=76
PostFormatCheckGroupBox.Checked="false"
RadioButtonInvertCase.Checked="false"
RadioButtonLowercase.Checked="false"
RadioButtonSentenceCase.Checked="true"
RadioButtonTitleCase.Checked="false"
RadioButtonUppercase.Checked="false"
RepEdit.Text="https://secure.wikimedia.org/wikipedia/$1/wiki/$2"
ReplacementCheckGroupBox.Checked="true"
StripLeadingEdit.Text="<,>,],["
StripperCheckGroupBox.Checked="true"
StripTrailingEdit.Text=
TrailingCheckGroupBox.Checked="false"
TrimLeftCountEdit.Value=0
TrimLineCheckGroupBox.Checked="false"
TrimRightCountEdit.Value=0

119
Clipboard Help+Spell / Modify Format/Case: Sanitize Amazon.com URL
« on: February 12, 2009, 12:38 AM »
I "sanitize" some of my amazon.com URLs using CHS' Modify Format/Case functionality, changing things like:

http://www.amazon.com/Six-Thinking-Hats-Edward-Bono/dp/0316178314/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=somethinghere&sr=8-1

to:

http://www.amazon.com/Six-Thinking-Hats-Edward-Bono/dp/0316178314/

In my ClipboardHelpAndSpell\PresetFormats\ directory I have a filed named "SanitizeAmazonURL.preset.format", that contains:

[FormattingForm.rsPropSaver1]
acCheckGroupBoxAddEntire.Checked="false"
AddPrefixEdit.Text=
AddStuffCheckGroupBox.Checked="false"
AddSuffixEdit.Text=
ApplyCheckGroupBox.Checked="true"
ChangeCaseCheckGroupBox.Checked="false"
CheckBoxAddToBlanks.Checked="false"
CheckBoxEvenBetween.Checked="false"
CheckBoxFixedFont.Checked="false"
CheckBoxIndent.Checked="false"
CheckBoxJustify.Checked="false"
CheckBoxNewlineSentences.Checked="false"
CheckBoxNoSpacesInTrimLines.Checked="false"
CheckBoxPostAfterPrefix.Checked="true"
CheckBoxRemoveLinebreaks.Checked="false"
CheckBoxSearchCaseInsensitive.Checked="true"
CheckBoxSearchRegEx.Checked="true"
CheckBoxTrimExcessBlankLines.Checked="true"
CheckBoxTrimExcessWhitespace.Checked="true"
CheckBoxWordWrap.Checked="false"
CheckGroupBoxTrimLeft.Checked="true"
CheckGroupBoxTrimRight.Checked="true"
FindEdit.Text="^(.*\/)ref=.*$"
LabeledEditEntirePrefix.Text=
LabeledEditEntireSuffix.Text=
LeadingCheckGroupBox.Checked="false"
NumberEditWidth.Value=76
PostFormatCheckGroupBox.Checked="false"
RadioButtonInvertCase.Checked="false"
RadioButtonLowercase.Checked="false"
RadioButtonSentenceCase.Checked="true"
RadioButtonTitleCase.Checked="false"
RadioButtonUppercase.Checked="false"
RepEdit.Text="$1"
ReplacementCheckGroupBox.Checked="true"
StripLeadingEdit.Text="<,>,],["
StripperCheckGroupBox.Checked="true"
StripTrailingEdit.Text=
TrailingCheckGroupBox.Checked="false"
TrimLeftCountEdit.Value=0
TrimLineCheckGroupBox.Checked="false"
TrimRightCountEdit.Value=0

120
FARR Plugins and Aliases / FARR plugin: Bakko
« on: February 02, 2009, 08:24 PM »
Bakko - Transformations of FARR Text Field Content

Introduction

  The main point of this plugin is to provide a customizable means for transforming the main FARR window's text field content.  At the moment, "customizable" means that the user can write a bit of JavaScript to operate on the text field content.  It's also possible that people could share these bits of JavaScript :)

Usage Examples

  1. Bring up FARR and type some text into the text field.

  2. A statusbar icon should appear at (or near) the bottom right of the FARR main window,  Click (currently, left-click) on this icon to bring up some possible transformations.

  3. Some or all of the following may appear -- try one by clicking on the corresponding context menu item.

       Evaluate
         original text:
           2 / 3
         replaced with:
           0.6666666666666666
         original text:
           (1 + 2 + 3) * (-1 + Math.pow(2, 3)) // note: use of JavaScript
         replaced with:
           42

       Factor
         original text:
           6
         replaced with:
           1 * 2 * 3

       ROT13
         original text:
           or fher gb qevax lbhe binygvar
         replaced with:
           be sure to drink your ovaltine

       Sanitize Amazon.com URL
         original text:
           http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/ref=stuff
         replaced with:
           http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/

  4. There is rudimentary support for access to a history of text strings which were successfully operated on (but not the results).  The strings in the history may be accessed via the History submenu of the statusbar menu.  NOTE: The history does not currently survive plugin reloads nor FARR restarts.

Creating a Transformation

  Each transformation is implemented as a JavaScript file living in the directory %PLUGINDIR%\transformations\.  Before reading further, I suggest opening up one of the samples in a text editor -- the following description may be easier to follow.  Choosing the shortest sample may be a good idea ;)

  The JavaScript file gets eval()-ed (nasty word, eh?) and the plugin expects the eval() result to be an object.

  The samples accomplish this by starting the file w/:

    (function () {

  and ending it w/:

      return {name: name,
              caption: caption,
              hint: hint,
              icon: icon,
              launch: launch,
              display: display,
              code: code};
    } ());

  (In case it wasn't obvious, what evaluation of that does (as I understand it), is to call a function which returns an object.)

  In between, define the following (some optional):

    name
      string
        no spaces

    caption(stxt)
      function
        returns a string for the menu item's caption.  currently, the returned string gets truncated and " ..." is appended if it is too long (see source of plugin for details).
        stxt is the string value of the content of FARR's main window text field at the time the context menu is being constructed.

    hint(stxt) optional
      function
        returns a string for the hint of the menu item.
        stxt is the string value of the content of FARR's main window text field at the time the context menu is being constructed.

    icon(stxt) optional
      function
        returns a string of the path to an icon for the menu item.
        stxt is the string value of the content of FARR's main window text field at the time the context menu is being constructed.

    launch(stxt)
      function
        returns a string used by FARR to execute the transformation code -- typically returns values looking like:
          farr://pcommand bakko xform <name> <stxt>
        stxt is the string value of the content of FARR's main window text field at the time the context menu is being constructed.

    display(stxt) (optional)
      function
        returns a boolean, true if the transformation should show up in the context menu, false if not.
        stxt is the string value of the content of FARR's main window text field at the time the context menu is being constructed.

    code(argtxt)
      function
        returns a string or null. 
          a string value represents a successful transformation and FARR's main window text field should be replaced with it. 
          a null value means failure.
        argtxt is currently the same as stxt (as mentioned above).

  The transformation has access to variables and functions within the plugin's (function () {} ()) scope (I think).  What this means is that displayname, aliasstr, pu, and the like may all be used within transformations. 

  If something isn't clear (or you think there are mistakes) here, I suggest asking on the forums and/or "Use the source, Luke" ;)

Tips

  Having a hotkey defined to bring up FARR with clipboard content pasted in FARR's main window can be handy.

Bugs

  Probably ;)

Credits

  Thanks go out to:

    mouser
    ecaradec
    Plugin authors that provided source and/or comments on the forums
    DC Forums participants
    DC Supporters


Download

  Experimental - please ensure that the parent directory of the contained fscript.js file is named Bakko.

Pages: prev1 ... 19 20 21 22 23 [24] 25 26 27next
Go to full version