Welcome to the presentation of my Offline BBCode Editor skript based on Autohotkey script language. :mrgreen:
Description:
It's a small BBCode Editor that lets you write a forum posting offline including all bbcode formatting options. Other features:
[*:3b3kpork]Save and load your postings.
[*:3b3kpork]Resizable GUI.
[*:3b3kpork]Add signatures to your postings. (possible workaround for 255 char limit within some boards.)
[*:3b3kpork]Supports language english/german via Ini file. Create your own language file and simply copy it to the 'lang' subfolder.
[*:3b3kpork]Preview mode to see how your posting will look like.
[*:3b3kpork]Support for ten user-defined BBCodes.
[*:3b3kpork]F-Key (F1, F2, ...) Hotkeys for easier formatting. Including well known Alt hotkeys from phpbb.
[*:3b3kpork]Tag compose mode - add more than one bbcode tag by using Ctrl key
At the moment the script is specialised for the phpbb forum, but it can be adjusted for any other forum.
Due to using RegEx inside the script, your version of Autohotkey has to be 1.0.46+ when you want to use the source files.
If you have created a language file on your own, feel free to share it with the community. I'll add it to a future release if you're interested.
Tag compose mode:
Some words about the new compose mode. Imagine you want to apply more than one tag at once - make use of the Ctrl key.
E.g. you want a word bold and italic formatted. Highlight the word, press Ctrl, press the bold button, release the Ctrl key and press italic button. Voilà . This also works without highlighting a word. In this case the caret is moved inside the tags to start writing.
As long as you hold the ctrl key, the tags are copied to clipboard. The first button press without holding the Ctrl key will paste the collected tags.
Give it a try.
Preview:
The user d-man discovered a way to speed up displaying of the preview window. Instead of using a browser as preview application he proposes to use MSHTA.exe within your windows\system32 folder. MSHTA loads much faster than any browser window.
In order to use MSHTA.exe simply open preferences via File Menu and specify C:\Windows\system32\MSHTA.exe as your prefered browser.
Enclosed Hotkeys:[*:3b3kpork]F1 - Bold
[*:3b3kpork]F2 - Italic
[*:3b3kpork]F3 - Underline
[*:3b3kpork]F4 - Quote
[*:3b3kpork]F5 - Code
[*:3b3kpork]F6 - URL
[*:3b3kpork]F7 - Unordered List
[*:3b3kpork]F8 - List Element
[*:3b3kpork]F9 - FontColor
[*:3b3kpork]F10 - Image
[*:3b3kpork]F12 - Smileys
Some further details can be found on the new AHK BBCodeWriter documentary homepage:
:arrow: AHK BBCodeWriter Homepage
Download & Installation:
You can it download it here:
:arrow: BBCodeWriter v7.0.2 Compiled + NSIS Installer
:arrow: BBCodeWriter v7.0.2 Sourcecode
Old version
BBCodeWriter v6.6 Compiled + NSIS Installer
BBCodeWriter v6.6 Sourcecode
Attention: Some users reported that BBCodeWriter contains a virus. This is a false postive from your virus scanner. Let me assure you BBCodeWriter is free of viruses. Your scanner reports a virus because of Autohotkey using upx.exe.
:!: Sourcecode:
Simply extract the zip file to a folder and run "main.ahk". :mrgreen:
:!: NSIS Installer:
I created a new NSIS installer. The small bug of the former installer is fixed. If you don't want a start menu entry, simply uncheck the corresponding box during install.
The new installer also creates an entry within your control panel's software list. In this way you can uninstall AHK BBCodeWriter very easily. It also comes with an uninstall.exe. Uninstalling AHK BBCodeWriter doesn't delete the programs folder including all your signatures and saved postings. If you want to get rid of them too, simply delete the remaining folder in your explorer.
The Scripts:
Take a look at the scripts if you like:[*:3b3kpork]main.ahk
[*:3b3kpork]functions.ahk
[*:3b3kpork]hotkeys.ahk
[*:3b3kpork]BBCodeEditor.ahk
[*:3b3kpork]BBCodePreview.ahkChangelog:
18.05.2007
+ fixed bug in RenameHelper routine - wrong highlighting when 'Hide known extension' is active (thx cuzabis)
16.05.2007
+ fixed bug in BBCodePreview.ahk - BBCode tags within url tags weren't displayed (thx Pastilhas)
24.04.2007
+ fixed minor typo in HandleMessage function - functions.ahk
+ added the hotkeys known from within the phpbb software - hotkeys.ahk
+ updated BtnEditSig subroutine - editing signatures sets window title; easier saving with Ctrl+S - BBCodeEditor.ahk
+ updated BtnUrlDesc subroutine - highlighted text within EdtComment is used as link text (thx roundtrip)
+ updated GuiClose subroutine - Use GuiControlGet instead of ControlGetPos - Use associated variable instead of ClassNN
+ updated ChkSig, ShowTip and RebuildGui1 suboutine - use controls' assosciated variables instead of ClassNN
+ replaced old 'IfWinActive' method within hotkeys with #IfWinActive directive - BBCodeEditor.ahk
+ several cosmetic indentation changes inside main.ahk, BBCodeEditor.ahk, functions.ahk
+ updated Titans Anchor function to v3.4.2
+ added 'Default' option to 'Submit' button within FontGUI
+ added Custom BBCode button bar - can be deactivated under 'Preferences'
+ added ComposeMode capabilities for Custom buttons
+ updated HandleMessage function to support more than one URL inside About GUI
+ added Ctrl-Shift-End hotkey for restoring BBCodeWriter.ini - hotkeys.ahk
+ fixed list bug in BBCodePreview.ahk - wrong parsing in case of more than one 'not-nested' list (thx SLMB)
+ updated AboutGUI - Link to BBCodeWriter thread changes depending on the used language
+ added "Clear history" button to 'Preference GUI' - clears list of recent files in File Menu
22.08.2006
+ added another part to statusbar - shows used tags within ComposeMode
+ removed drag&drop support - too many side effect/bugs - sorry for that
+ updated MsgBox when exiting script - clipboard won't be restored anymore
+ added 'Check for updates' option to HelpMenu
+ fixed BtnSend subroutine - Window lost WinTitle when pushing 'Copy' button (thx roundfile)
20.08.2006
+ changed preview.html in BBCodePreview.ahk - new logo to get smaller header (thx Mart)
+ fixed some minor errors in html code and style.css
+ using #IfWinActive directive inside hotkeys.ahk instead of old method
+ removed "clipboard flush" when starting the script - disadvantages outweighed the benefits
+ added drag&drop support for edit control (thx laszlo)
+ updated "Credits GUI"
+ updated OpenRecentFile subroutine - shows error if file cannot be found/was deleted
+ updated FontSize GUI - easier formatting with buttons instead of DropDownList - similar to ColorGUI
18.07.2006
+ fixed bug in 'SavePosting' subroutine (Ctrl+S) - Gui1 title length not hardcoded anymore (thx jballi)
06.07.2006
+ updated compose mode - control key (Ctrl) is now magic key for compose mode
Please post any errors you find because the script may be buggy. (especially the preview routine)
AHK BBCodeWriter v7.0.2 - An offline BBCode Editor
Started by
AGermanUser
, Nov 02 2005 11:54 PM
65 replies to this topic
#1
-
Posted 02 November 2005 - 11:54 PM
Cheers
BBCodeWriter • ToDo-List • CopyPassage
BBCodeWriter • ToDo-List • CopyPassage
Hi AGU,
Very nice job. Well structured and documented.
I found one thing in the main.ahk that might at some point cause trouble:
Because I'm sure that the last gosub is never executed. Test it with
To prevent future misbehavior you should reorganize the lines to:
Very nice job. Well structured and documented.
I found one thing in the main.ahk that might at some point cause trouble:
; Include script for creating HTML Preview #Include functions.ahk #Include %A_ScriptDir%\phpbb\BBCodeEditor.ahk #Include %A_ScriptDir%\phpbb\BBCodePreview.ahk ; Create Main Window GoSub, CreateMainGui ReturnYou are lucky, because functions.ahk and BBCodePreview.ahk only contain functions but no auto-exec-section with a return.
Because I'm sure that the last gosub is never executed. Test it with
; Create Main Window MsgBox, Am I right? GoSub, CreateMainGui ReturnYour auto-exec-section stops inside the BBCodeEditor.ahk, because it contains a return after the CreateMainGui routine.
To prevent future misbehavior you should reorganize the lines to:
;execute autoexec of BBCodeEditor.ahk GoSub, AutoExecBBCodeEditor ;*** you need to add a RETURN in the file after the autoexec section *** ; Create Main Window GoSub, CreateMainGui Return ; end of auto exec ; Include script for creating HTML Preview #Include functions.ahk AutoExecBBCodeEditor: #Include %A_ScriptDir%\phpbb\BBCodeEditor.ahk #Include %A_ScriptDir%\phpbb\BBCodePreview.ahkOr something like that. Maybe even taking the autoexec section part from BBCodeEditor.ahk into the main.ahk script.
#3
-
Posted 03 November 2005 - 08:58 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
I see your point. You're right.Because I'm sure that the last gosub is never executed.
I placed that section there, because I wanted some kind of modular design. In case someone wants to adjust the script for his/her favorite forum/board you just have to create another folder in %A_ScriptDir%, copy "BBCodeEditor.ahk" and "BBCodePreview" in that new folder and change the #Include Directive in the main.ahk script.Maybe even taking the autoexec section part from BBCodeEditor.ahk into the main.ahk script.
This is the reason why I moved the code to "BBCodeEditor.ahk". Cause the button variables, Font colors, FontSizes are phpbb specific.
Therefore I would prefer your first solution and would add another label "AutoExecBBCodeEditor" in BBCodeEditor.ahk. What do you think about it? And what about that design/modular thing?
#4
-
Posted 03 November 2005 - 12:23 PM
I like the design, moduls, nameing conventions, comments, indentation. I could read the code easily.
The only thing I could spot is that the section on BtnAddSmileyXX actions could be easily simplified.
The only thing I could spot is that the section on BtnAddSmileyXX actions could be easily simplified.
#5
-
Posted 03 November 2005 - 02:46 PM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
Hi AGU,
This is an excellent and very useful script! Thank you for sharing it.
I wanted a larger edit window so I made the following changes to make the height of the edit window configurable. There may be a better way to do the same thing but this may be a worthwile enhancement.
To main.ahk is added
Thanks again, this is a wonderful script!
-roundfile
This is an excellent and very useful script! Thank you for sharing it.
I wanted a larger edit window so I made the following changes to make the height of the edit window configurable. There may be a better way to do the same thing but this may be a worthwile enhancement.
To main.ahk is added
;Number of rows (lines) displayed in the edit window NumEditRows = 25BBCodeEditor.ahk is modified to be:
Gui, Add, Edit, vEdtComment xs ys+30 r%NumEditRows% w600 Section OffsetLowerBtns := (NumEditRows+1) * 13 Gui, Add, Button, gBtnSend xs+238 ys+%OffsetLowerBtns% w60, &Copy
Thanks again, this is a wonderful script!
-roundfile
#6
-
Posted 03 November 2005 - 03:12 PM
@roundfile
@toralf
I like your idea. I'll add your code to the script. Maybe I'll add another menu entry "preferences" and a gui that lets the user change the number of rows by saving it to an ini file. I'll have a look on this.I wanted a larger edit window so I made the following changes..
@toralf
Do you mean it that way?The only thing I could spot is that the section on BtnAddSmileyXX actions could be easily simplified.
; List of Smileys for Smiley GUI ListOfSmileys = :D.:).:(.:o.:shock:.:?.8).:lol:.:x.:P.:oops:.:cry:.:evil:.:twisted:.:roll:.:wink:.:!:.:?:.:idea:.:arrow:.:|.:mrgreen: StringSplit, ArrayOfSmileys, ListOfSmileys, .
BtnAddSmiley1: SmileyNumber = 1 GoSub, AddSmiley Return
AddSmiley: Smiley = ArrayOfSmileys%SmileyNumber% Clipboard := %Smiley% Gui, 1:-Disabled Gui, 4:Destroy GuiControl, 1:Focus, EdtComment Send, ^v Clipboard = ReturnOr dio you see a better/shorter way?
#7
-
Posted 03 November 2005 - 08:59 PM
@toralf
Wouldn't deleting of
;execute autoexec of BBCodeEditor.ahk GoSub, AutoExecBBCodeEditor ;*** you need to add a RETURN in the file after the autoexec section *** ; Create Main Window GoSub, CreateMainGui Return ; end of auto exec ; Include script for creating HTML Preview #Include functions.ahk AutoExecBBCodeEditor: #Include %A_ScriptDir%\phpbb\BBCodeEditor.ahk #Include %A_ScriptDir%\phpbb\BBCodePreview.ahkDon't know why, but I doesn*t work.
;*** you need to add a RETURN in the file after the autoexec section ***You mean BBCodeEditor.ahk, right? After adding a return after the autoexec section in BBCodeEditor.ahk running the script results in not appearing of the main gui.
Wouldn't deleting of
; Create Main Window GoSub, CreateMainGui Returnin main.ahk be a solution?
#8
-
Posted 03 November 2005 - 09:29 PM
:oops: :oops: :oops: forgot to move
above the #Include directives.
Now it works.
; Create Main Window GoSub, CreateMainGui Return
above the #Include directives.
Now it works.
#9
-
Posted 03 November 2005 - 09:38 PM
ListOfSmileys = :D.:).:(.:o.:shock:.:?.8).:lol:.:x.:P.:oops:.:cry:.:evil:.:twisted:.:roll:.:wink:.:!:.:?:.:idea:.:arrow:.:|.:mrgreen: StringSplit, ArrayOfSmileys, ListOfSmileys, .That is a good way, but I would use a Tab (or sometimg else, e.g. `n) to separate the items, since a . can be in a smiley. When you want to use a `n you can use a continueation section so that it is easy to maintain.
How about this: Only one routine for all smiley buttons?
... Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley1 xs ys+20 h22 w22 +%BS_ICON% ... BtnAddSmiley: StringTrimLeft, SmileyNumber, A_GuiControl 12 Smiley = ArrayOfSmileys%SmileyNumber% GoSub, 4GuiClose ;see remarks below GuiControl, 1:Focus, EdtComment Clipboard := %Smiley% Send, ^v Clipboard = ReturnMaybe use ControlSend, and I do not think you need Clipboard, the strings are short. Just set key delay low.
#10
-
Posted 04 November 2005 - 07:32 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
Can you tell me how to do it with a continuation section? I tried it, but it doesn't work for me.... you can use a continueation section so that it is easy to maintain.
Method #1 only works with "and", "or", ||, &&, a comma, or a period at the beginning of the line.
Method #2 has difficulties with the parantheses inside the smileys. Tried to escape the smiley parantheses - but doesn't work.
I like your solution with A_GuiControl and one routine for all buttons.
#11
-
Posted 04 November 2005 - 09:49 AM
I meant method #2, I do not know what problem you mean with "difficulties with the parantheses inside the smileys"
this works
this works
ListOfSmileys = (LTrim :D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: ) StringSplit, ArrayOfSmileys, ListOfSmileys, `n Loop, %ArrayOfSmileys0% { Item := ArrayOfSmileys%A_Index% String = %String%|%item% } MsgBox, %ListOfSmileys%`n============`n%String%
#12
-
Posted 04 November 2005 - 10:08 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
A richedit control would be nice for wysiwyg editing..
#13
-
Posted 04 November 2005 - 11:32 AM
:oops: forgot LTrim within the parantheses.I do not know what problem you mean with "difficulties with the parantheses inside the smileys"
Your code works well and it's definitely easier maintainable.
Concering one routine for all smiley buttons:
... Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley1 xs ys+20 h22 w22 +%BS_ICON% ... BtnAddSmiley: StringTrimLeft, SmileyNumber, A_GuiControl, 12 Smiley := ArrayOfSmileys%SmileyNumber% GoSub, 4GuiClose GuiControl, 1:Focus, EdtComment Control, EditPaste, %Smiley%, Edit1, %ScriptName% Returndid it for me. I even hadn't to set key delay low. Control, EditPaste is obviously very fast with edit controls. Code is much shorter now, cause I could delete this whole bunch of BtnAddSmileyXX code blocks. Thanks again for this good tip.
#14
-
Posted 04 November 2005 - 11:37 AM
@Titan
Haven't heard of this and can't find anything about it in the docs. Where can I find it?A richedit control...
#15
-
Posted 04 November 2005 - 11:40 AM