Random sorts

Started by oblivion, September 12, 2015, 12:00:58 PM

Previous topic - Next topic

oblivion

One of the things I use HippoEdit for is editing .m3u playlists.

A useful feature would be to be able to select a group of lines and sort them randomly -- preferable to using the shuffle feature on my music player as I can inspect the list more easily and arrange things to be more apparently random -- two songs by the same artist moved apart, that sort of thing.

So maybe instead of just "sort ascending" and "sort descending" there could also be a "sort random"?

Thanks!

alex

Hi,

I have added plugin for shuffling of lines. You can already get it in Online repository or install directly from HippoEDIT (Updates manager or Tools->Options->Plugins->Shuffle Lines)
More details on wiki: http://wiki.hippoedit.com/plugins/shuffle_lines

BR, Alex
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

alex

Thanks Alex!!
Great job and unbelievable support!
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

oblivion

Quote from: alex on September 15, 2015, 12:45:17 PM
Thanks Alex!!
Great job and unbelievable support!
Indeed :) Marvellous! Thanks!

Sorry for the delay in getting back on this, I posted the query and then went on holiday!

oblivion

I've just discovered it doesn't always work.

In particular, I've been compiling a playlist of Christmas songs (yes, yes, I know, but it's that time of year) on my Windows 10 64-bit machine and the plugin resolutely fails to do anything at all.

Should I remove it and reinstall? Is there any way of finding out what the problem is?

alex

Quote've just discovered it doesn't always work.
it does not help too much in analyzing the issue... Provide sample text you used and step by step instruction of how to reproduced (what was selected, where cursor etc).
I would say it shall work, there is not too much logic in... Check if plugin is enabled in Tools->Options->Plugins.

QuoteShould I remove it and reinstall? Is there any way of finding out what the problem is?
Reinstall normally shall not help. If it crashed (JS code) and stops working, normally restarting HE shall help. But I have doubts that it is your case.

If you want to find out what is an issue, you can "debug" it:
- open file shuffle_lines.hejs from %HippoEDIT Install Dir%\plugins
- put "alert("I am here!");" in function "vCommand.onExecute = function() {" before "var sel = ActiveView.Selection;".
- than you can at least see is it called and can move alert further in code to see, where it jumps out.
- actually it is normal JavaScript code, so you can use alert or Output().writeln to dump any variables to see the state.

Sorry, there is not too much other debug possibilities.

Best regards,
Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

oblivion

Struggling here.

I've reinstalled everything. Is it relevant that this is the 64-bit version?

Should plugins be in the \program files\ tree rather than \programdata or somewhere a bit less protected in the documents tree? (Obviously, HE needs to be run with admin privileges to edit a plugin stored in \program files...)

Not working means exactly that. Select the text (it's an .m3u8 file with a list of mp3 files in it, one on each line, I'm sure I don't need to explain playlists to you!) and choose the shuffle lines plugin. And then wait. The lines stay selected, the order of the lines doesn't change.

Current HippoEdit (1.60) 64-bit, Windows 10 with 14Gb RAM and no obvious issues.

The wordcount plugin functions as it should, so general plugin functionality is clearly okay.

alex

what I can say - by me works.

Windows version, HippoEDIT x86/x64, memory size does not matter.
The storage of plugins proper - you will be asked for admin privileges, then they needed. You shall not start HE as Administrator.

Debug it in a way I have suggested or provide here step by step instruction how to reproduce. Without it we will not go further.
As:
- exact example text you have (as text)
- exact selection you had (screenshot)
- menu Format -> Shuffle Lines ?
- content of file shuffle_lines.hejs
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

oblivion

Quote from: alex on December 17, 2015, 11:48:44 AM
- menu Format -> Shuffle Lines ?

:-[ Tools. It's on the Tools menu. That's the place it doesn't work.

Oops...

Sorry.

So what's the entry on the tools menu for?

alex

All plugins are "service scripts" that live resident in HippoEDIT process and react on events (as menu command selection or shortcut).
Have you checked the wiki, I have posted before: http://wiki.hippoedit.com/plugins/shuffle_lines ? There was described how to use plugin...

What you see in Tools menu it is just installation for the service script. If it will be "tool script" than it will be as you expected. And the fact that you see the shuffle_lines.hejs there, it is only recent script list.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]