Author Topic: Random sorts  (Read 1532 times)

Offline oblivion

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Random sorts
« on: September 12, 2015, 11:00:58 am »
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!

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2161
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Random sorts
« Reply #1 on: September 12, 2015, 04:35:38 pm »
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

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2161
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Random sorts
« Reply #2 on: September 15, 2015, 11:45:17 am »
Thanks Alex!!
Great job and unbelievable support!

Offline oblivion

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Random sorts
« Reply #3 on: October 02, 2015, 06:43:00 am »
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!

Offline oblivion

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Random sorts
« Reply #4 on: December 12, 2015, 06:57:33 pm »
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?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2161
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Random sorts
« Reply #5 on: December 14, 2015, 11:17:11 am »
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.

Quote
Should 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.

Offline oblivion

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Random sorts
« Reply #6 on: December 16, 2015, 10:50:51 pm »
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.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2161
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Random sorts
« Reply #7 on: December 17, 2015, 11:48:44 am »
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

Offline oblivion

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Random sorts
« Reply #8 on: December 17, 2015, 08:07:54 pm »
- 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?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2161
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Random sorts
« Reply #9 on: December 18, 2015, 10:43:19 am »
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.

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
2266 Views
Last post April 15, 2009, 01:16:22 am
by alex