Tuesday, August 20, 2019

Little changes for Magellan

I've made some little changes to Magellan that should make us Icaros users happier. First of all, I found on DOpus 5 website a link to a newer version (a nightly build of v5.92 from 2016), which should be more polished and advanced than the one (v5.91) currently included in Icaros Desktop. I'm testing it right now without pain, so it should be good for 'production'. This was, indeed, a good time for two little changes I was thinking about for a while.

First of all, I wanted to get rid of 'Archive' button misbehavior: under Icaros Desktop, the 'Archive' button in listers created either a LHA, or a ZIP, or a TAR archive if you selected two or more files and pressed it with the left, right or center mouse button. Why 'two' and not 'one' or more? That's because of the way Magellan seems to handle the operation. According to DOpus 5 documentations, in fact, if I set an action like this:

lha a {ou-}.lha {O}

I should get an archive named like the first selected file (which wouldn't be unselected), with the original extension replaced by .lha, which would include all selected files (that would be immediately selected afterwards). So, if we select these files:

one.txt
two.doc
three.jpg

and click the 'LHA Archive' button, I should get a 'one.lha' archive containing all three. In reality, this mechanism is somewhere broken. In fact, if I try to follow what Magellan is actually doing, I can easily discover that the command performed would be the following instead:

lha a one.lha two.doc three.jpg

In a nutshell, the first one would be 'renamed' as intended but ignored by the {O} part. Until now, I worked around this by adding a {o} that would consider the first selected file to be archived (one.txt) as well. So this command was used:

 lha a {ou-}.lha {o} {O}

which produced a command like this:

lha a one.lha one.txt two.doc three.jpg

What was the problem, then? For some reason, you can't use {O} instead of {o} when you have a single selected file to consider. Magellan for some unknown reason creates its temporary script in T: but does not execute it. Why? Well, I simply can't understand it. The solution, by the way, has been easier that I could think and it's been replacing the 'naming' part with a file requester that would ask the user for the name of the resulting archive. Something like:

 lha a {RF} {O}

which now produces a result like this:


Just enter a name for the archive, and it will be created, even if you have selected a single file or a single directory to be 'frozen'. This way, without any apparent logic, capital {O} flawlessly works with single file selections. 

Translate