DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Open alias/group in notepad++  (Read 9,855 times)

ahkscript

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 11
Open alias/group in notepad++
« on: January 09, 2019, 04:57 AM »
Is it possible to open alias/group in notepad++, do some editing and have FARR apply changes to alias/group?
Don't mind paying someone to create an addon to do that.
Thanks

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Open alias/group in notepad++
« Reply #1 on: January 09, 2019, 04:59 AM »
Can you elaborate a little bit on what you have in mind, and the motivation for not wanting to use the built-in FARR alias editing facility in options?

ahkscript

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 11
Re: Open alias/group in notepad++
« Reply #2 on: January 09, 2019, 05:04 AM »
Notepad++, which I'm sure you are familiar with, is a great text editor. I can achieve a lot and quickly using it.
I'm thinking maybe an addon that would copy a group content to a temporary file, wait for it to be changed and apply changes in FARR.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Open alias/group in notepad++
« Reply #3 on: January 09, 2019, 12:27 PM »
FWIW I'm (slowly) working on an AutoHotkey helper program to replace FARR's built in methods for editing aliases. Not ready for release yet, but working good so far in my test use. Some features:
- jump directly to alias editor window from FARR
- search/filter box with live filter (very useful when you have a lot of aliases)
- some syntax syggestions in the alias edit window
- shortcuts to create regex aliases
- FARR is still usable while the alias editor window is open

Here are some notes on where and in what format FARR stores its aliases, based on me testing things and from looking around in FARR files. Mouser can correct me if I'm wrong on anything here.

FARR stores aliases in .alias XML files. The default user file is
Code
<MyDocuments> \DonationCoder\FindAndRunRobot\AliasGroups\MyCustom\myaliases.alias

other FARR settings including the list of disabled (uncheckboxed) aliases are in
Code
C:\Users\ <user> \Documents\DonationCoder\FindAndRunRobot\FindAndRunRobot.ini

You can edit the .alias file in Notepad++ or any code editor, but it is a bit clunky to manually edit .xml. However if you for example want to change a folder path in a lot of aliases then it'll be easy to do a find/replace all in this file.

Some more notes on interacting with the above files:
- Edits to myaliases.alias have effect when FARR starts.
- Important: FARR adds to .alias the line "<Disabled>true</Disabled>" for each disabled alias. But that only mirrors the authoritative setting in FindAndRunRobot.ini > [Settings] > DisabledAliasStrings
- Edits to FindAndRunRobot.ini only stick when made while FARR is not running, otherwise FARR restores the old values from working memory.

To prevent FARR from restoring old values use this method to change aliases from an external script:
1 exit FARR  (commandline -exit)
2 edit .alias / .ini and save
3 run FARR  (commandline -hide)

Edit: it is easy to mess up with direct edits to the .alias / .ini files so make sure you create backups of them first.
« Last Edit: January 09, 2019, 12:47 PM by Nod5 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Open alias/group in notepad++
« Reply #4 on: January 09, 2019, 03:46 PM »

You can already send FARR a windows message (or is it commandline call) to make it RELOAD its aliases after you have changed them outside of FARR.. Let me look it up and tell you how to do that.. That prevents the need to exit and restart FARR.
So the process would simply be to edit the alias outside FARR, and then send FARR them command to make it reload its aliases from file.  No problem.

As far as the original request -- it would helpful to hear more about what is important to you to understand what is important and not-important.  For example, it would be trivial to add a button to the options tab where you are looking at an alias to tell it to open an alias in an external text editor.. but I can't tell if being able to quickly edit an alias file without having to go to options alias page is the part that's important to you..



ps. Very cool, Nod5! Looking forward to seeing an alpha.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Open alias/group in notepad++
« Reply #5 on: January 09, 2019, 07:28 PM »
You can already send FARR a windows message (or is it commandline call) to make it RELOAD its aliases after you have changed them outside of FARR.. Let me look it up and tell you how to do that..
I'm all ears about windows messages for FARR, haven't tried that method. Before using the exit-edit-start method I tried editing while FARR was running and then sending the special string "goareload" to the FARR editbox , but that it isn't silent (FARR must be open and FARR also forces the special string agroups afterwards) and cannot handle enabling/disabling aliases I think since FARR will override the disabled/enabled change from memory or .ini. Previous thread on that here http://www.donationcoder.com/forum/index.php?topic=45199.0

ahkscript

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 11
Re: Open alias/group in notepad++
« Reply #6 on: January 10, 2019, 04:17 AM »
I can't tell if being able to quickly edit an alias file without having to go to options alias page is the part that's important to you..
That's exactly what I'm looking for, a way to edit aliases in Notepad++ without having to go through options windows. And of course have FARR reload edited aliases.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Open alias/group in notepad++
« Reply #7 on: January 10, 2019, 12:05 PM »
a way to edit aliases in Notepad++ without having to go through options windows. And of course have FARR reload edited aliases.

Ok, here is a quick fix to do that.
Caveats: you'll have to manually edit xml formatted data and you won't be able to disable/enable aliases but can edit/create/remove.

Step 1: create a new FARR alias
Change "<username>" and perhaps the path strings below to match those on your PC

name: notepad++ myaliases edit
regex: ^ali$
results:
edit aliases in notepad++ | C:\Program Files (x86)\Notepad++\notepad++.exe C:\Users\<username>\Documents\DonationCoder\FindAndRunRobot\AliasGroups\MyCustom\myaliases.alias

Step 2: make this AutoHotkey helper script start with Windows
When control+s is pressed in Notepad++ and the active file is named myaliases.alias and FindAndRunRobot.exe is running then the script exits FARR, performs the save and then restarts FARR. In all other cases control+s should perform a normal save in Notepad++.

Code: ( autohotkey)
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance force

;farr_notepad++_helper_script

farr := "C:\Program Files (x86)\FindAndRunRobot\FindAndRunRobot.exe"

#IfWinActive ahk_exe notepad++.exe
^s::
WinGetActiveTitle, win_title
if RegExMatch(win_title, "^.+\myaliases.alias - Notepad..$") and processExist("FindAndRunRobot.exe")
{
  ;if notepad++ active tab is myaliases.alias and FARR process exist
  ;then exit FARR, apply save, silently restart FARR
  RunWait "%farr%" -exit
  send ^s
  sleep 100
  Run "%farr%" -hide
}
else
  send ^s
return
#IfWinActive

;function: check if process exists
processExist(process_name){
  process,exist,% process_name
  return errorLevel ;PID or 0
}

Create a backup of your myaliases.alias before testing this in case you or the script unexpectedly mess upp the file.

An alternative to the always running hotkey script in step 2 is to create another FARR alias that only temporarily runs a script with the same exit save restart steps if the last active window before FARR was notepad++ with myaliases.alias open. In this alternative you'd instead of control+s use a FARR alias to initiate the save.
« Last Edit: January 10, 2019, 12:11 PM by Nod5 »

Original address: https://www.donationcoder.com/forum/index.php?topic=47030.0