Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Close File Function
noforker
Newbie
Posts: 11
Permalink
Post Close File Function
on: June 22, 2018, 14:46
Quote

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?

2MR2
Administrator
Posts: 1113
Permalink
Post Re: Close File Function
on: June 22, 2018, 15:13
Quote

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.

2MR2
Administrator
Posts: 1113
Permalink
Post Re: Close File Function
on: June 22, 2018, 15:58
Quote

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.0.34 ; Page loaded in: 0.04 seconds.