Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF Export writes messages in reverse order #32

Open
tripleee opened this issue Nov 1, 2019 · 4 comments
Open

PDF Export writes messages in reverse order #32

tripleee opened this issue Nov 1, 2019 · 4 comments

Comments

@tripleee
Copy link
Contributor

tripleee commented Nov 1, 2019

It doesn't seem to matter how I arrange the message view -- the PDF export writes them from newest to oldest, rather than the opposite. This is easy to fix if you are moderately computer literate, but a weird quirk which should hopefully not be too hard to fix.

(Giving the messages a sane naming structure would also help. It seems that the message's index number within the folder is the last component of the filename before the .pdf extension.)

@tripleee
Copy link
Contributor Author

tripleee commented Nov 1, 2019

In case you are not moderately computer literate, try something like

for msg in ./*.pdf; do
    idx=${msg##*-}
    idx=${idx%.pdf}
    printf -v new "%05i-%s.pdf" "$idx" "${msg%-$idx.pdf}"
    echo mv "$msg" "$new"
done

Assuming you only have PDF files in the current directory which adhere to the expected naming convention, this should update their names to move the message index to the beginning of the file name, zero-padded to five digits.

The echo prevents the rename from actually doing anything -- take it out if the results look reasonable.

This should work in Bash, i.e. on Mac and Linux and other U*x. If you are a Windows victim, I can only offer my condolences.

@cleidigh
Copy link
Collaborator

@tripleee
Under the filename option section you can set 3 message items to be included in the filename.
You can move the index to the front of the filename in this fashion. Is that a partial solution?
I am not sure I have the control the write order
@cleidigh

@tripleee
Copy link
Contributor Author

tripleee commented Nov 12, 2019

Not really, though it's nice to have control over that of course. Does it make the message index zero-padded so the messages sort correctly out of the box?

@cleidigh
Copy link
Collaborator

cleidigh commented Feb 7, 2020

@tripleee
check out #75
will the full formatting help in your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants