PF Forum Helper [Forum Utility]
Dogtag
Moderator, Betatester Traveler
Hi folks,
The ProFantasy forum lets us use HTML tags or BBCode tags to format text, add working hyperlinks, and insert images. But most forum users don't know HTML or BBCode. And even for those of us that do, it sure would be nice if there was a quicker, easier way to do it.
Well, now there is!
Introducing the utility that you never knew you wanted but that you thought, maybe, someday, you might possibly think about potentially entertaining the notion, of considering the idea, that you may want!
Important: I wrote this utility myself and thought others might like it. It is not a ProFantasy product, nor is it associated with ProFantasy Software Ltd in any way. This is just something I thought people might find useful, like any other tutorial, walk-thru, or forum post, etc.
Download and unzip the contents to any folder. The zip file includes a ReadMe file with instructions that I highly recommend you read. Double-click the PF Forum Helper.exe file to run it. If your system does not display file extensions, it's the file with the square green icon with an "H" on it). It's a small compiled script that will run in the background. It won't do anything unless you are on a ProFantasy Community Forum web page. Your antivirus might protest (I use Avast, and it made a small fuss) but there's no virus or malware in the script. I also included the uncompiled script in the zip file (.ahk extension) so the coding wonks here can review or modify if they want.
PF Forum Helper Help
PF Forum Helper makes use of text commands, called "hotstrings," and keyboard shortcuts, called "hotkeys." Most of the information below is intended for use when you are typing a message for the forum, so strange things might happen if you try one of the hotstrings or hotkeys when your cursor is not inside the message text box where you write your forum posts. Three notable exceptions are Alt+F1, Pause, and F12, which can be used anywhere on the ProFantasy Forum site.
Remember, you can always press F12 to exit or press Pause to temporarily disable/re-enable the functionality without completely exiting.
I hope you find it useful!
Cheers,
~Dogtag
The ProFantasy forum lets us use HTML tags or BBCode tags to format text, add working hyperlinks, and insert images. But most forum users don't know HTML or BBCode. And even for those of us that do, it sure would be nice if there was a quicker, easier way to do it.
Well, now there is!
Introducing the utility that you never knew you wanted but that you thought, maybe, someday, you might possibly think about potentially entertaining the notion, of considering the idea, that you may want!
(Click the link above to download from my site.)
Important: I wrote this utility myself and thought others might like it. It is not a ProFantasy product, nor is it associated with ProFantasy Software Ltd in any way. This is just something I thought people might find useful, like any other tutorial, walk-thru, or forum post, etc.
Download and unzip the contents to any folder. The zip file includes a ReadMe file with instructions that I highly recommend you read. Double-click the PF Forum Helper.exe file to run it. If your system does not display file extensions, it's the file with the square green icon with an "H" on it). It's a small compiled script that will run in the background. It won't do anything unless you are on a ProFantasy Community Forum web page. Your antivirus might protest (I use Avast, and it made a small fuss) but there's no virus or malware in the script. I also included the uncompiled script in the zip file (.ahk extension) so the coding wonks here can review or modify if they want.
Note: This utility was written using a Windows scripting/macro language called AutoHotkey, so I'm pretty certain that it will only work on Windows operating systems. My apologies to the Mac/Linux forum goers. For anyone who's interested (and I suspect very few are) see the next post, below, for nerdy info on how this utility came about, what I used to make it, and how you can fairly easily make personal modifications.
Also, this script was written on, and for, a standard English-language keyboard. I haven't tested it on a non-English keyboard, but I hope it works.
Also, this script was written on, and for, a standard English-language keyboard. I haven't tested it on a non-English keyboard, but I hope it works.
PF Forum Helper Help
PF Forum Helper makes use of text commands, called "hotstrings," and keyboard shortcuts, called "hotkeys." Most of the information below is intended for use when you are typing a message for the forum, so strange things might happen if you try one of the hotstrings or hotkeys when your cursor is not inside the message text box where you write your forum posts. Three notable exceptions are Alt+F1, Pause, and F12, which can be used anywhere on the ProFantasy Forum site.
HOTKEYSYou can use the following keyboard shortcuts. The first few add standard Windows formatting shortcuts so you can format text in your post more or less like usual. NOTE: These keyboard shortcuts are not toggles. That is, they will apply the formatting but they will not remove it. However, if necessary, you can do that easily enough by deleting the HTML tags they add.
Ctrl+B
Bolds the selected text. If no text is selected, it inserts the HTML tags for bold text and puts the insertion point between them so you can type the text that you want bolded instead.
Ctrl+I
Italicizes the selected text. If no text is selected, it inserts the HTML tags for italic text and puts the insertion point between them so you can type the text that you want italicized instead.
Ctrl+U
Underlines the selected text. I included this for completeness but it is not recommended because people are conditioned to see underlines as hyperlinks. If no text is selected, it inserts the HTML tags for underlined text and puts the insertion point between them so you can type the text that you want underlined instead.
Ctrl+- (hyphen)
Strikes through the selected text. If no text is selected, it inserts the HTML tags for strike-through text and puts the insertion point between them so you can type the text that you want struck through instead. NOTE: This uses the actual hyphen key. It does not work with the minus sign on the numeric keypad.
Ctrl+Shift+Space
Inserts the HTML entity for a non-breaking space ( ). This is similar to the behavior in Microsoft Word. Most folks probably won't use this but it's here just in case.
Alt+I
Inserts an image tag, for displaying external images. This is the same as typing pfimage (see below). Note that it uses the Alt key, not the Ctrl key.
Alt+H
Turns the selected text into a hyperlink. YES! Finally, right? For example, if you select the word, "discussion" and then press Alt+H, it will add the anchor (hyperlink) tags to "discussion" so "discussion" will be the linked (clickable) text. You can then replace the ALLCAPS text with the URL of the link. If no text is selected when you press this hotkey, it acts the same as the pflink hotstring.
NEW in version 1.1: If you select a link that you already typed, like http://profantasy.com, and it begins with "http" or "https" then this command will add the HTML to make the selected link clickable.
Alt+P
Encloses the selected text in samp ("sample output") tags, or inserts empty samp tags if no text is selected. This formats text in a monospace font and can be used to represent sample output from the computer. This is what I typically use when specifying CC3+ command line prompts and commands. Text between samp tags also ignores other HTML formatting, such as bold, italic, etc.
Alt+S
Encloses the selected text in span tags, or inserts empty span tags if no text is selected. This is for people who use to format text using CSS. Most people probably won't use this shortcut.
Alt+F1
Displays this discussion topic in a new browser tab. Kind of like a quick and easy help page.IMPORTANT! Please test this hotkey in your browser when you are on the ProFantasy Forum website but NOT in the middle of typing a message. I've tested it in multiple browsers on my system and it works great but make sure it opens in a new tab on your system to ensure you don't accidentally lose what you were typing.
Pause
Pressing the Pause key temporarily disables the hotstrings and hotkeys. the icon in the Windows system tray will change to show an "S" (for "suspended"). Pressing the Pause key again restores the hotstrings and hotkeys.
F12
Exits the PF Forum Helper script. To re-enable the PF Forum Helper, you must run it again.
HTML TAGSPF Forum Helper also includes a few nice features for folks who are already comfortable using HTML tags in their forum posts. If you begin typing the following HTML tags normally, PF Forum Helper will autocomplete them for you and place the insertion point in between the opening and closing tags, or between the quotation marks for the primary attribute (e.g., the style attribute for span or the href attribute for a). The following tags autocomplete:
- a
- b
- i
- img
- ol (PF Forum Helper also adds the first list item tag)
- samp
- span
- sub
- sup
- ul (PF Forum Helper also adds the first list item tag)
HOTSTRINGSYou can also type the text commands ("hotstrings") below, followed by a space, a punctuation mark, or Enter, to activate them.I welcome comments and, especially, reports of any strange or unexpected behavior. I can't promise how much support, if any, I can provide, since I only did this for fun and all, so please be patient if I don't get to something right away.
pfimage
Inserts an image tag, for displaying external images. Replace the ALLCAPS text with the URL of the image.
pflink
Inserts a hyperlink (aka an anchor) tag. Huzzah! Replace the ALLCAPS text as instructed by the text.
pflistnum
Inserts the framework for a numbered list. It also displays a short help message to remind you how to use the inserted HTML to make your list. This command also has several alternates:pflistbullet
- pfnumlist
- pfnumberlist
- pfnumberedlist
- pfnumbers
Inserts the framework for a bulleted list. It also displays a short help message to remind you how to use the inserted HTML to make your list. This command also has a couple of alternates:--
- pfbulletlist
- pfbulletedlist
- pfbullets
Inserts the HTML code for an em dash (—) after you type two hyphens and a space. This is similar to the behavior in Microsoft Office products.
===
Inserts the HTML code for a horizontal rule (a line) after you type three equal signs and press the space bar. It's automatically set to span 100% of the width of your post but you can easily change that by editing the tag that gets inserted. Just be sure to keep the % sign. If you don't want the horizontal rule to be centered in your post, you can delete margin:auto; from the tag. Be sure to keep the double quotes but delete the semicolon.
pfbox
Inserts a framed DIV tag. This creates a frame where you can enter text, similar to those found in the Tips and Tricks discussion, or the table of contents in Monsen's Command of the Week discussions.
pfframe
Same as pfbox.
IMPORTANT: I mentioned this before but it bears repeating. This is a personal project and is not associated with ProFantasy Software Ltd in any way, so please do not bother Ralf, other ProFantasy folks, or the ProFantasy support desk with any questions. They're focused on their actual products and, besides, they know as much about it as you do.
Remember, you can always press F12 to exit or press Pause to temporarily disable/re-enable the functionality without completely exiting.
I hope you find it useful!
Cheers,
~Dogtag
Comments
Watch this space. If you're into geeky stuff like this, that is.
Reading the documentation, I suggests a change to Alt+H (Hyperlink). Many people already type out the url in text, just never turn it into a link. I don't know the capabilities of AutoHotKey (usually using AutoIt myself), but could you make it so if it resembles a link, it puts the link in the href field, instead of a generic placeholder? (And add http if it doesn't already start with http, https, ftp or similar)? (Just a suggestion, don't make it for my sake, I am probably not going to end up using this myself)
For now, if someone has already typed the URL, they can select it, copy it, press Alt+H, and then paste the URL as the link target. That'll make the URL they typed into a clickable link.
Alternatively, they can cut it, press Alt+H, paste it as the link target, and then replace the link text placeholder with a word or phrase.
Honestly, both of those scenarios are pretty much what I was thinking originally, so I may end up sticking with that for now.
Interestingly enough, according to Wikipedia, AutoHotkey is a fork from earlier AutoIt code, when someone's proposal to integrate hotkey support into AutoIt v2 failed to generate support in the community. Ha!
So, now, I just need focus on work, not play!
Work, not play... work, not play... work, not play...