Welcome Guest

Pages: 1
Close File Function
noforkerPostJune 22, 2018, 14:46
Newbie
Posts: 17
Registered:
July 25, 2016, 01:03
Normal topicClose File Function

I’m working on an Action that utilizes the “Copy Metadata from…” function to copy metadata from the file at index 0 to index 1. I have other steps in the action I’d like to add, but I’d like to close the file at index 0 first. Is this possible?

2MR2PostJune 22, 2018, 15:13
Avatar photo
Administrator
Posts: 2079
Registered:
August 23, 2012, 19:27
Normal topicRe: Close File Function

The action mechanism is tightly bound to the set of files passed to it. This can be selected files or the contents of a folder when Batch Processing. As a result, there is no way to close a file in an action and to continue processing. Being able to close and continue would open the possibility of having 'no open files' and currently that would 'be very bad'. As this cannot happen currently there is no testing for that condition.

The only way to get around this limitation is to set a track variable to 1 for all files except the file at index 0 and to 0 for index 0. You could then embed all further activity in an inline action which is called by a Run statement only if the variable is true. This would mean that all subsequent execution would have to be grouped.

Test if the numeric value of property 'File Index' != 0 (Set result and Variable 0)
Run inline action 'Other Stuff' grouped if Variable 0 is true

Start Other Stuff - The file at index 0 will not be processed
' Put other processing here

If you do not have to run stepwise, the above code will effectively do it. If you have to run stepwise ... sorry.

2MR2PostJune 22, 2018, 15:58
Avatar photo
Administrator
Posts: 2079
Registered:
August 23, 2012, 19:27
Normal topicRe: Close File Function

I've given this a little more thought. In the upcoming v4.2, I've re-enabled the Stop Action and Filter Files statement to work again with a filter which tests a variable. This was broken in v4.0 as all variables are cleared when an action terminates. Variable 0, is the only variable which the filter can test.

I could add a statement called 'Remove Files From Processing'. This would only work when running stepwise and would effectively remove any file with a non zero value for Variable 0 from consideration. It would not close the files. However, when stopping an action the original set of files would be restored. This means that after your processing, a Stop Action and Filter Files statement could be executed to close, hide or select any removed files. The statement would fail if no files would be left open. The action test state would be set so you could test if it worked.

This could be used to remove files and still enable renumbering, etc. to work as expected.

This could not be implemented until post v4.2 as a point level release.

Make sense?

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.033 seconds.