So it turns out that the #javascript command 'new set' will de-duplicate an array. So I simply had to pass in the #ACARS flight plan waypoint list into that and get out the other end a very clean #SkyVector URL.
Attached is a very long civil flight plan as an example.
Here is example of before de-duplicate. A lot of the waypoints were in twice and often had a return leg, so you ended up with 'weird' routes like this one.
Two more examples of 'bad' (dirty) flight plan to SkyVector ULR's - been looking at these for weeks, so yeah, just sharing my pain<grin>
The double legs really annoyed me, but you can see how much cleaner the new URLs are.
The code can do both civil and military FPN ACARS.