Selection order

English support forum

Moderators: Hacker, petermad, Stefan2, white

HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Selection order

Post by *HBB »

I'm frequently using a vbs script which join multiple pdf files to a single file (by using some command line pdf tools). I attached the script to a button with parameters %Q%P%S.

My problem is about the file list order which are sent to the script (same as the one in the panel). I need to send the files in a custom order (e.g., selection order in the panel).

Is there any way to do it?

A new special character for user's file (and/or dir) selection order could be helpfull (For example %C%Q%P%S). But, there isn't as I know.

Regards
meisl
Member
Member
Posts: 171
Joined: 2013-12-17, 15:30 UTC

Post by *meisl »

Could you expand on what exactly you mean by "selection order"?
User avatar
white
Power Member
Power Member
Posts: 6014
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Selection order

Post by *white »

HBB wrote:I'm frequently using a vbs script which join multiple pdf files to a single file (by using some command line pdf tools). I attached the script to a button with parameters %Q%P%S.

My problem is about the file list order which are sent to the script (same as the one in the panel). I need to send the files in a custom order (e.g., selection order in the panel).

Is there any way to do it?
As a workaround you could create a custom column for [=tc.comment] and sort by this column. Then put order number in the comment for each file. The files will be sorted on the fly. When you are done, mark the files and run your script.


BTW. You mention you use %Q. If have seen a suggestion for %Q on the forum, but it has not been implemented, has it?
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

White wrote:
As a workaround you could create a custom column for [=tc.comment] and sort by this column. Then put order number in the comment for each file. The files will be sorted on the fly. When you are done, mark the files and run your script.
I knew the TC's Comments may help as you described. Because of the problems to backup descript.ion files, currently I don't prefer it (even if I know that it is very usefull). Maybe later.


meisl wrote:
Could you expand on what exactly you mean by "selection order"?
What I mean "User's selection order" is the file selection sequence in the source panel with mouse right-button click or space/ins key by user (or marking or highlighting or whatever it is).

For example, I marked the files in the following order:
1) Cover.pdf 2) Index.pdf 3) Body.pdf 4) Attachments.pdf

Normally %Q character for the button bar parameters does not sense this order and send the parameters to the script as follows (if the source panel is set to view files in alphabetic order):
1) Attachments.pdf 2) Body.pdf 3) Cover.pdf 4) Index.pdf

I want to sent the files in a order as I selected.


White wrote:
You mention you use %Q. I have seen a suggestion for %Q on the forum, but it has not been implemented, has it?
In fact, I don't have any suggestion about %Q. I said only an additional new letter (e.g. %C) which may sort the files in user's selection order in panel. This is a suggestion (which is not regularly suggested yet).


Currently, I solve the problem by adding some numbers to beginning of file names. But, this is not good way. Especially, if I need to add a new file, to change numbers take time. Some times, I have a tons of drawing files which should be joined.
User avatar
white
Power Member
Power Member
Posts: 6014
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

HBB wrote:
As a workaround you could create a custom column for [=tc.comment] and sort by this column. Then put order number in the comment for each file. The files will be sorted on the fly. When you are done, mark the files and run your script.
I knew the TC's Comments may help as you described. Because of the problems to backup descript.ion files, currently I don't prefer it (even if I know that it is very usefull). Maybe later.
I see. It would be nice if you could use files.bbs and descript.ion at the same time. The internal content plugin "tc" could be expanded with tc.comment1 (comment from files.bbs) and tc.comment2 (comment from descript.ion). Or perhaps using a modifier, for example: tc.comment.filesbss and tc.comment.description.

A new command "cm_SwitchCommentFile" may be useful too.
HBB wrote:White wrote:
You mention you use %Q. I have seen a suggestion for %Q on the forum, but it has not been implemented, has it?
In fact, I don't have any suggestion about %Q. I said only an additional new letter (e.g. %C) which may sort the files in user's selection order in panel. This is a suggestion (which is not regularly suggested yet).
Above you say that %Q sends file names to the script, but %Q does not do anything..
HBB wrote:Currently, I solve the problem by adding some numbers to beginning of file names. But, this is not good way. Especially, if I need to add a new file, to change numbers take time. Some times, I have a tons of drawing files which should be joined.
I don't see why it should take much time when using a good renaming scheme in the multi-rename tool. Do you know that in the multi-rename tool you can sort the list, drag around lines in the list and even delete lines from the list?
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

- I know renaming tool very well and I already use it. Yes it helps a little bit.

- You are right about %Q, this is my mistake. %P%S is enough to send multiple files to the script. But, it does not effect my suggestion.

- I agree with you about using the comments. It could help a lot especially by using both descript.ion and files.bbs.

What do you think about my suggestion? Doesn't it solve the problem completely. By this way, there is no need to any other sorting in the panel. Just selecting the files in the desired order, then pressing a button. Finished... This feature may help for some other cases. E.g., to open files in a custom order (pictures, musics, movies, etc.)

What does Author think about this suggestion. Is it possible?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Are there any other really practical needs to store information about selection order? I don't see such. Is any other software able to restore selection order? I doubt.

I think that it would be much more usable for you to write two scripts (or same script with 2 modes): add selection mode and execute mode. So, you focus files and press shortcut that calls script, and it selects file in TC (for visual purpose) and adds it to list (for further command). When list is done, you launch execute mode that starts processing using already generated list with correct order.
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

MVV, hello.

Your suggestion is one of the solutions. But, it may have two problems.

1) Selection problem: Select a file, press a button. Select a file press a button....Then press another button to comlete it. It needs a lot off pressing a button.

2) While selection, the script should hold the file names in a file. If I get a phone and forget to clean cache and I restart the procedure again, then some problems may happen.

Your suggestion is possible, but it is dangerous a little bit.

Regards
User avatar
HolgerK
Power Member
Power Member
Posts: 5412
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

- Enter the vbs-script name into command line (could be an alias)
- Focus the first PDF-File
- Press <Ctrl+Enter>
- Focus the second PDF-File
- Press <Ctrl+Enter>
...
- Focus the command line
- <Enter> to execute

Done

Regards
Holger
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

HolgerK, it is excellent.

This is most nearest solution to the problem. But I need full path of files. Is it possible?

Do you have any suggestion an easy way to write script name to the command line automatically?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Ctrl+Shift+Enter inserts full paths.

You can use tools that send keypresses to paste text to TC command line. E.g. TCFS2.
1) Selection problem: Select a file, press a button. Select a file press a button....Then press another button to comlete it. It needs a lot off pressing a button.
Yes, a bit uncomfortable, but specific procedure won't be mixed with something else. And, it is much more usable with shortcut for selecting script: click file, press shortcut, click file, press shortcut, etc. Just easy as HolgerK's idea but with better visualization (selection).
2) While selection, the script should hold the file names in a file. If I get a phone and forget to clean cache and I restart the procedure again, then some problems may happen.
You can easilly compare cached ordered selection with current TC unordered one and process only items that are actually selected now. Or just take last N files from selection cache where N is the number of selected files in TC (but I would prefer to compare selections anyway).
User avatar
HolgerK
Power Member
Power Member
Posts: 5412
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

If all files reside in the same directory it should be easy to get the current directory inside the vb-script and add this path to the command line arguments.

Regards
Holger
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

MVV:
And, it is much more usable with shortcut for selecting script: click file, press shortcut, click file, press shortcut, etc. Just easy as HolgerK's idea but with better visualization (selection).
Both yes and no. Button needs mouse use. Or, may be same difficulty... You may be right.

MVV:
You can easilly compare cached ordered selection with current TC unordered one and process only items that are actually selected now. Or just take last N files from selection cache where N is the number of selected files in TC (but I would prefer to compare selections anyway).
This may not be so easy. Additionally I need 4 buttons: Clean, Check, Select and Execute.

MVV and HolgerK, Very thanks for the suggestions, they were very helpfull. I will try both of them. They are more easy than the renaming files as I did.

Regards
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It doesn't require mouse, you can navigate files in any way and then press shortcut.

It is enough 2 buttons/commands: 'select' and 'process'. 'Select' accumulates items and indicate selected ones with selection (it is easy to send Insert or Space keypress to TC window). When you execute 'process', it processes accumulated selection and cleans cache. And, it is not a problem with outdated cached files if you check actual selection. Finally, with no selection 'process' may simply purge the cache (which may be e.g. in temp folder).
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

MVV,

Assume 4 files will be processed: 1) A.pdf 2) B.pdf 3) C.pdf 4) D.pdf

Desired order: 1) C.pdf 2) B.pdf 3) D.pdf 4) A.pdf

1) Select C.pdf (highlighted by INS/SPACE key). Press SELECT button. %P%S sends: "C.pdf"

2) Select B.pdf (highlighted by INS/SPACE key). Press SELECT button. %P%S sends: "B.pdf" "C.pdf"

3) Select D.pdf (highlighted by INS/SPACE key). Press SELECT button. %P%S sends: "B.pdf" "C.pdf" "D.pdf"

4) Select A.pdf (highlighted by INS/SPACE key). Press SELECT button. %P%S sends: "A.pdf" "B.pdf" "C.pdf" "D.pdf"

For each SELECT action, in the script: the files is read from file + compared by new list + desired order is determined + writen to file again.

OK. Now, just before pressing DONE button,assume that you saw a mistake and decided to change order of files. How do you clean the cache? Do you press DONE button to clean the cache?

You wrote:
Are there any other really practical needs to store information about selection order?
Answer is yes according to me. Read file + write file + compare file + clean cache + ... is not so easy than sending the files in selection order in button parameters.

EDIT> Otherwise, it is possible to say there is no need %P%S parameters to send files cumulatively. Each time files can be selected by a button and progress can be started by an another button.
Post Reply