The eccoMAGIC Forums
http://forums.eccoMAGIC.com/forum/YaBB.pl the SLANG EXTENSION and Guest Programming >> Slang Rules Scripts, Functions, Examples and HOW TO >> Auto 'sort' sub-items to different parent items http://forums.eccoMAGIC.com/forum/YaBB.pl?num=1350395424 Message started by Admin on 10/16/12 at 08:50:24 |
Title: Auto 'sort' sub-items to different parent items Post by Admin on 10/16/12 at 08:50:24 This fantastic script was posted by phkiefer at http://tech.groups.yahoo.com/group/ecco_pro/message/12252 : The idea for this came from my experimenting with the BrainStormSW outliner. I've decided against adopting it as Ecco can so much more, but since this particular BSSW feature was missing from Ecco and since Slang's set_item_parent() function has made it so easy to implement, I came up with this script. I'm just an amateur programmer, so don't expect perfection and feel free to suggest any improvements. I'm sure some bugs will need to be weeded out, some more precautions put in etc. Be sure to backup your file(s) before you try it - or preferably try it out on a dummy file first. How to get started: Naturally, EccoExt is required for it to work. To set it up
What the function does: 1. To make an item a parent item that other items can be sorted under, add an equals symbol plus a single digit at the beginning of the item's text. Say you have an item called "First parent". Change the item text to "=1First parent". Then execute the function (see above). The "=1" will disappear and the "First parent" item is now marked to be sorting parent destination number "1". The function will remember this between sessions by writing the item's ID to a file in the same folder and with the same name as your currently open .eco file, but with the extension ".srt". You can use all digits from 0 to 9, so you can sort under up to 10 different parent items. 2. To sort items under any parents marked in the way described above, add a single digit at the start of the item's text, this time without the preceding "=". E.g., change "First child" to "1First child", execute the function and - ZOOM - the digit will be removed and the item moved to just under the item marked as sort parent number "1". The cursor now sits at the beginning of the next item. To move this to the same location, just type 1 and execute the function. Or use any other digit to send it under a different parent. This can be extremely useful when sorting collections of ideas into an outline, after either a keyboard brainstorming session in Ecco or importing notes from other applications / a mobile device (Let's all hope CompanionLink will really offer an Ecco product soon!) or when sorting stuff that was lazily dumped somewhere to be sorted some other time. Setting up a hotkey: If you want to use the function regularly, I suggest you call it via a hotkey: Click "Tools|Launch|Manage Launch Menu..." in Ecco's menu bar. Create a new launch item. Make sure "Launch as:" is set to "Document", not "Program". In the "Command:" edit box, enter: "LUAScript: SortToParent()". Now count the items in the "Manage Tools Menu" dialog and remember which position the new entry you just created is in. Then right-click EE's tray icon and select EccoExt Options... Go to the "ShortCut" tab and select "Tool" from the dropdown list. Scroll down and click on "Launch Menu Item X", X being the position of your newly created launch item in the dialog above. Enter the desired shortcut in the "New shortcut" edit box and click the "Assign" button. Okay, here comes the code: Code:
|
The eccoMAGIC Forums » Powered by YaBB 2.1! YaBB © 2000-2005. All Rights Reserved. |