topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 4:58 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Runnable .format files  (Read 4874 times)

jathri

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Runnable .format files
« on: September 22, 2016, 08:24 PM »
Hello,
what do you please think of making files from c:\Users\...\Documents\DonationCoder\Clipboard Help+Spell\PresetFormats\ runnable? So as these presets can be used in scripts?
See for example https://autohotkey.c...ocs/commands/Run.htm. A script could then look like this:
...
clipboard = %nameofthevariable%
runwait, c:\Users\...\Documents\DonationCoder\Clipboard Help+Spell\PresetFormats\TrimLineBreaks.preset.format
msgbox %clipboard%
Or it could work like this (using parameters somehow):
clipboard = %nameofthevariable%
runwait, C:\Program Files (x86)\Clipboard Help+Spell\ClipboardHelpAndSpell.exe /TrimLineBreaks.preset.format
msgbox %clipboard%
Thank you for your consideration on this matter.
« Last Edit: September 22, 2016, 08:32 PM by jathri »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Runnable .format files
« Reply #1 on: September 29, 2016, 05:15 AM »
Hi Jathri.

It's an interesting idea.. I guess the biggest impediment is just a gut feeling that for commandline execution of text formatting scripts, one would probably be better off using a nice little language designed for manipulating text (perl perhaps), since those languages have so much more power than CHS formatting presets.

Having said that.. It wouldn't be such a crazy idea to make a standalone tool of a different name, like SimpleTextFormatter which basically was just the text formatting functionality of chs, designed to be run manually or via commandline.

jathri

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: Runnable .format files
« Reply #2 on: October 08, 2016, 02:54 AM »
Hello!
Thanks for your reply.
So it would work like this (in scripts or in windows .lnk shortcuts):
...\SimpleTextFormatter.exe "c:\Users\...\Documents\DonationCoder\Clipboard Help+Spell\PresetFormats\TrimLineBreaks.preset.format"
And CHS GUI would then become presets creator for these shortcuts, am I right?
jathri

EDIT: Or at least I would welcome for it to be CHS compatible.
« Last Edit: October 08, 2016, 08:49 AM by jathri »

jathri

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: Runnable .format files
« Reply #3 on: October 09, 2016, 05:57 AM »
It crossed my mind that CHS itself could use SimpleTextFormatter.exe via command line, am I right? So as to all the format functions do not need to be developed twice.
Please see also https://github.com/hi5/TF for some of the functions which are not yet implemented in CHS: TF_CountLines, TF_ReadLines, TF_RemoveLines etc.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Runnable .format files
« Reply #4 on: October 09, 2016, 05:00 PM »
@Jathri:
I think I see what you mean, but am not sure. I could be wrong, of course, but what you are suggesting would seem to be of limited potential use to most users.
Where @mouser says:
...Having said that.. It wouldn't be such a crazy idea to make a standalone tool of a different name, like SimpleTextFormatter which basically was just the text formatting functionality of chs, designed to be run manually or via commandline.

-have you considered bundling those AHK text formatting commands into an AHK script (or compiled as a .exe), giving it (say) a GUI for the user to select which commands they want to apply? The script could then be called by FARR and used to edit the text contents of the system clipboard or the CHS clipboard buffer (if those things were possible) or a designated text file where the text contents of the clipboard had been saved.
This could be more easy to use for most users than (say) them having to know how to invoke the separate commands individually, or (say) @mouser having to program in some text manipulation commands which might be of only limited use to most users. If the AHK script was compiled as a .exe, then it could presumably be packaged as one of the many optional plugins for FARR, and it wouldn't necessitate users having to install AutoHotkey.

Just a thought. I don't know how practicable that might be.

jathri

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: Runnable .format files
« Reply #5 on: October 11, 2016, 03:25 AM »
Have you considered bundling those AHK text formatting commands into an AHK script (or compiled as a .exe), giving it (say) a GUI for the user to select which commands they want to apply?
> The library I posted is very useful in many cases but it has its flaws. I agree with mouser that using language designed for manipulating text is desirable here. But you are right that as soon as SimpleTextFormatter is available I was going to create this GUI (using AHK) and assign it to some single hotkey. But perhaps it can be done directly in CHS then.

This could be more easy to use for most users than (say) them having to know how to invoke the separate commands individually.
> Why not bundle SimpleTextFormatter.exe together with CHS and add possibilty to create windows .lnk shortcuts for existing presets then? Or add mentioned single click (hotkey) GUI for the users to select which commands they want to apply. Perhaps this simple GUI can be shown when running SimpleTextFormatter.exe withnout any parameters.

jathri

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: Runnable .format files
« Reply #6 on: October 26, 2016, 05:48 AM »
Just discovered very useful Copy and Format hotkey (Options/Hotkeys). It copies selected text from currently active app, evokes Modify Format/Case GUI (just it, no CHS in background), lets you format text and then paste it back to original app (if possible). Thank you for this BTW.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Runnable .format files
« Reply #7 on: October 26, 2016, 06:37 AM »
I'm sorry I didn't think to mention that.. somehow I assumed you had already found that obscure hidden feature :)

I normally trigger my formatting presets from the Quick Popup menu myself, but setting a hotkey for a specific formatting preset can speed up the process if you are doing it a lot.

Glad it's useful to you  :up: