From File rename v3.1

Hi,

Bug report [v3.1], I guess.

Let's say I have those lines as source:

test 01.avi
test 02.srt
test 03.txt

It works great if they are in Clipboard Text.txt but completely fails if the exact same lines are in the clipboard:

From file rename script by Henrik Ripa
No files and nothing in clipboard to use as source text
No more names in source text
No more names in source text
No more names in source text

Can someone confirm this bug.

My use will only be from clipboard so I can't use it as it is now :confused:

Hi fred,
no, I can't confirm this; here everything works fine.
I have these 3 files:

file1.avi
file2.srt
file3.txt

I copy the following lines to the clipboard:

test 01.avi
test 02.srt
test 03.txt

After renaming the result is:

test 01.avi.avi
test 02.srt.srt
test 03.txt.txt

This looks strange but since the script leaves the file extension alone and the source lines contain additional file extensions, it works exactly as described.
MartO

Hmm, I can't reproduce this either. It works for me on Windows 7 x64 with DOpus 10.1.0. Unfortunately, I don't have a Windows XP machine to test with.

It looks like the script doesn't recognize what is in the clipboard as text. But I have no idea why.

Thanks for report.

The problem comes from the focGetTextFromClipboard function. I'm investigating why the method fails on my XP SP3 (IE8) :confused:

If someone could test it on similar OS...

Ok, it works now. The problem came from my security settings (xp-antispy or comodo). I'll post as soon as I find out the guilty.

Ok, I found out the guilty.

In xp-antispy, if the javascript for IE is disabled focGetTextFromClipboard fails to access clipboard content.

So I have to enable Script in IE now. Although I use firefox, I would like to turned JS in IE off for security purpose, external programs can access it. It would be great that opus has a clipboard object that could be used in VBscript. :smiley:

Interesting. I tried to turn off scripting in explorer but it didn't seem to affect the clipboard in VBscript for me. I guess it works differently in Windows 7.

I just checked that on IE8.

It seems that the JS deactivation option in xp-antispy disables all objects that are in IE option > security tab > Internet > custom level > script included the clipboard access setting in there. This is the guilty.

Opus must be restart once you have made the changes in IE.

Just a quick post to say THANK YOU. I wish I had seen this years ago - it's obscenely useful :slight_smile:

Thank you. Best script ever for my large archive of files that need renaming.

:thumbsup: :thumbsup: :thumbsup:

How would you use this in Opus 12 beta? Thanks

In general, the same way you would have used it before. If something doesn't work, report it as a bug in the beta (via Help & Support, not here) as we aim not to break existing rename scripts.

This script works fine in DOpus 12 as it is. But I'm going to add support for having the settings in the rename dialog instead of in the script.

While I'm at it I was thinking of renaming it. The From File name isn't very descriptive. Especially since I suspect most use the clipboard feature now (I certainly do). From Clipboard is an obvious choice, but does anyone have any other suggestions?

Maybe

"Rename from List (Clipboard or Text File)"
"Rename from Clipboard or Text File"
"Names from Clipboard or File"

or similar.

It's often hard to come up with good names for these things. :frowning:

How should the text file read? I mean, what is the format?
Oldname, newname comma separated ? (like an export of Excel)
with/without column headers?

It's just a list of new names, which will be used in the order they're listed.

You can do the same thing in Opus 12 using this menu in the rename dialog, by the way:

Clipboard%20Image

(If the menu is ghosted out, turn off the macro option to the left of it.)

Thanks.
I noticed that feature, but regretfully for one reason or the other it does work out the way I would like, hence I was seeking for an alternative way.
Probably I might be doing something wrong.

I have the old names in front of me in Opus, sorted by name.
Copy-pasted the old names into Excel (column A)
Column A is sorted on the old names (original names), same as in Opus.

In Excel I had to sort the files on their total pixel size, then added 'Delete_ ' or 'Keep_' to the name.

After that, resorting on original name again.
I would expect the sort order would be the same as initially, but it turns out that Excel is sorting names differently then. Seems that Excel is taking other matters into account.

For example: in Excel the first 'old' name starts with a ( character, whereas in Opus the first character is a '

So, I was thinking of a method to import a list (e.g. a csv) with old and new names.

SnagIt-29042018%20134329

This seems very convoluted. If you want to rename based on pixel size you could use a script to do it automatically.

Workaround
to avoid different sorting in Excel, I calculated total pixels (W-pixels multiplied with H-pixels), but did not sort on that, as I did initially. Instead applied a formula
like if total pixel size=x, add keep_ to the name, else add delete_ to the name.
So the list kept the same sort order as Opus.

About the 'total pixel'-size thing, that's covered the other thread. We probably have different things in mind.

Anyway, it is solved now.
Sorry for the confusion.

oh, BTW, I don't know my way in scripting, regretfully so.

It seems like you don't want a "Total Pixels" column, you just want a way to sort "small images" from "large images". This is called an XY Problem.

If you just ask what you actually want to achieve we probably could have helped you much quicker.