PSU not Ingesting images

Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: PSU not Ingesting images

Post by Hert »

That's the one I mean.

And where are the leading and trailing %code and %/code in the rename rule? It's a script...

To fix it:
1. Clear the rename rule what you have now
2. Click the + icon
3. Select Add Script Part
4. Copy/Paste the script
AddScriptPart.png
AddScriptPart.png (17.85 KiB) Viewed 3031 times
You should see correct a sample file name:
ScriptSample.png
ScriptSample.png (14.28 KiB) Viewed 3031 times
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
fbungarz
Posts: 1826
Joined: 08 Dec 06 4:03
Location: Arizona, USA

Re: PSU not Ingesting images

Post by fbungarz »

Hi Hert,
Ahhhh! OK, sorry.
Looks like I am a bit thick, do you mean I need to paste the " "DownloadByPrefix_RenameRule.txt" as script code part?
This would explains why it does not work. I thought I had to paste it into the text window, here:
RenameRule.jpg
RenameRule.jpg (146.22 KiB) Viewed 3027 times
like so:
RenameRule_2.jpg
RenameRule_2.jpg (206.01 KiB) Viewed 3027 times


Code: Select all

// Construct a filname for IDI's downloader consisting of:
//   - A user entered prefix
//   - A sequential, zero-padded, 4-digit integer value
//   - The original extension
// Used as a rename script, this will allow a "group" of common basenames to be
// renamed with the same integer value.

// Input: file237.jpg file237.nef file416.jpg file416.nef file602.jpg file602.nef
// Output: <prefix>0001.jpg <prefix>0001.nef
//         <prefix>0002.jpg <prefix>0002.nef
//         <prefix>0003.jpg <prefix>0003.nef

// Notes:
//    - This script assumes the list of procesed filenames will be ordered
//      such that like basenames are consecutively processed.
//    - This script is designed to be used with the downloader pre-script
//      "Download by Prefix", as it manages some of the registry keys used
//      by this script.
// JAG, 16-Apr-2007
// HVZ, 23-Jun-2016 (converted to Photo Supreme)

var
  lastNumber: Integer;
  lastFile:   WideString;
  prefix:     WideString;
 
begin
  prefix     := ReadFromRegistry ('dlByPrefixCurrent', 'prefix', '');
  lastNumber := ReadFromRegistry ('dlByPrefixCurrent', 'value', 0);
  lastFile   := ReadFromRegistry ('dlByPrefixCurrent', 'filename', '');
  if (prefix = '') then prefix := 'UNKNOWN_'; 

  // If the current filename doesn't equal the last stored filename
  // increment our number and store both values to the registry
  if (lastFile <> '%FileName') then
    begin
       Inc(lastNumber);
       WriteToRegistry ('dlByPrefixLastVals', prefix, lastNumber);
       WriteToRegistry ('dlByPrefixCurrent', 'filename', '%FileName');       
       WriteToRegistry ('dlByPrefixCurrent', 'value', lastNumber);
  end

  // return our newly constructed filename
  result := prefix + AddLeadingChars (IntToStr(lastNumber), '0', 4, False) + '.' + '%FileExtension';
end;
I'll give this a try now...
Thanks,
Frank
fbungarz
Posts: 1826
Joined: 08 Dec 06 4:03
Location: Arizona, USA

Re: PSU not Ingesting images

Post by fbungarz »

Hurray!!!
It works.
Sometimes pictures (screenshots) say more than a thousand words.
Thanks so much and sorry for the confusion.
Frank

PS: Would it make sense to submit this with instructions to the resource repository?
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: PSU not Ingesting images

Post by Hert »

Great.
you can always submit it as a resource. Don't forget to set the resource as a 'Photo Supreme" type. The Resource site is being rewritten and only the PSU scripts will be migrated.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
fbungarz
Posts: 1826
Joined: 08 Dec 06 4:03
Location: Arizona, USA

Re: PSU not Ingesting images

Post by fbungarz »

I have just tried uploading the script plus instructions, but received the following error:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
I sent you a mail.
Post Reply