Jump to content

File Mass Rename loses Array Variable


dm812000
 Share

Go to solution Solved by mistersquirrle,

Recommended Posts

Hello all, first post ever as I am at my wit's end.

I am simply trying to combine two pictures and save with a new file name, but when going to the next in the list, I get . . .

 

(15) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$Filename = $FileList[$i]
$Filename = ^ ERROR

 

There are thousands of pictures I would like to be able to do this with, think of it as adding a watermark to thousands of pictures. I have renamed several thousands of files before using a similar script, not sure why adding in some GDI throws the error.  I don't think it has anything to do with the GDI commands, but do not know where else to turn. 

 

Thanks

 

#Include <GDIPlus.au3>
#include <Array.au3>
#include <File.au3>

_GDIPlus_Startup()

Global Const $sFolder = "C:\ItemsbyName\240x240\Organic"


Global $FileList = _FileListToArray($sFolder, "*", $FLTA_FILES )

 $Total = UBound( $FileList )

For $i=1    To $Total
 $Filename = $FileList[$i]
    $Filename3 = "9" & $Filename

$hImage1 = _GDIPlus_ImageLoadFromFile($sFolder & "\" & $Filename)
$hImage2 = _GDIPlus_ImageLoadFromFile(@DesktopDir & "\organic.png")
$hGraphics1 = _GDIPlus_ImageGetGraphicsContext($hImage1)

_GDIPlus_GraphicsDrawImage($hGraphics1, $hImage2, 0, 0 )

_GDIPlus_ImageSaveToFile($hImage1, $sFolder & "\New\" & $Filename3)

_GDIPlus_GraphicsDispose($hGraphics1)
_GDIPlus_ImageDispose($hImage1)
_GDIPlus_ImageDispose($hImage2)

_GDIPlus_ShutDown()

Next

 

Link to comment
Share on other sites

13 minutes ago, Danp2 said:

Arrays indexes are zero based, so try it like this --

For $i=0 To $Total - 1

 

Thanks for the speedy reply, when doing as suggested the script runs and closes, as if there was no work to do.  I have been increasing the starting number by 1 with each attempt, I am at 543 currently, so if I run it as

For $i=543 To $Total - 1

It runs, creates the 543rd picture in the list and closes without error, which is different.  prior to adding your suggestion for the "to" value, it was closing with the error I said before. Now it acts as if the For and To are the same number, so it runs the start number then finishes after the one item. 

Link to comment
Share on other sites

  • Solution

I suggest that you add some logging so you can see/watch the progress of it, and know when/where it fails:

#include <GDIPlus.au3>
#include <Array.au3>
#include <File.au3>

_GDIPlus_Startup()

Global Const $sFolder = "C:\ItemsbyName\240x240\Organic"

Global $FileList = _FileListToArray($sFolder, "*", $FLTA_FILES)
If @error Then
    ConsoleWrite('_FileListToArray error: ' & @error & @CRLF)
    Exit
EndIf
Global $Total = $FileList[0]
ConsoleWrite('$Total: ' & $Total & @CRLF)

If FileExists($sFolder & "\New\") = 0 Then
    DirCreate($sFolder & "\New\")
EndIf

For $i = 1 To $Total
    $Filename = $FileList[$i]
    $Filename3 = "9" & $Filename
    ConsoleWrite('$Filename (' & $i & '/' & $Total & '): ' & $Filename & @CRLF)

    $hImage1 = _GDIPlus_ImageLoadFromFile($sFolder & '\' & $Filename)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageLoadFromFile $hImage1 error: ' & @error & @CRLF)
        Exit
    EndIf
    $hImage2 = _GDIPlus_ImageLoadFromFile(@DesktopDir & "\organic.png")
    If @error Then
        ConsoleWrite('_GDIPlus_ImageLoadFromFile $hImage2 error: ' & @error & @CRLF)
        Exit
    EndIf
    $hGraphics1 = _GDIPlus_ImageGetGraphicsContext($hImage1)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageGetGraphicsContext error: ' & @error & @CRLF)
        Exit
    EndIf

    _GDIPlus_GraphicsDrawImage($hGraphics1, $hImage2, 0, 0)
    If @error Then
        ConsoleWrite('_GDIPlus_GraphicsDrawImage error: ' & @error & @CRLF)
        Exit
    EndIf

    _GDIPlus_ImageSaveToFile($hImage1, $sFolder & "\New\" & $Filename3)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageSaveToFile error: ' & @error & @CRLF)
        Exit
    EndIf

    _GDIPlus_GraphicsDispose($hGraphics1)
    If @error Then
        ConsoleWrite('_GDIPlus_GraphicsDispose error: ' & @error & @CRLF)
        Exit
    EndIf
    _GDIPlus_ImageDispose($hImage1)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageDispose($hImage1) error: ' & @error & @CRLF)
        Exit
    EndIf
    _GDIPlus_ImageDispose($hImage2)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageDispose($hImage2) error: ' & @error & @CRLF)
        Exit
    EndIf
Next

_GDIPlus_Shutdown()

As Danp2 mentioned $FileList[0] contains the number of records, or if you use UBound you need to do -1 since arrays start at 0, not 1.

I also moved _GDIPlus_Shutdown() out of the loop, since you don't need to be shutting it down each loop (especially since you're not explicitly starting it, though I think most GDI functions check if it's started).

Give that a run, and see how it processes, look at the console to see what file it's on. (I disabled all the GDIPlus stuff and ran it myself against my Downloads folder and it logged everything in there with no errors)

 

Edit: You may want to also either delete or move the file that you've just processed out of the folder you're scanning, so you don't accidentally process it multiple times

Edited by mistersquirrle

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

16 hours ago, mistersquirrle said:

I suggest that you add some logging so you can see/watch the progress of it, and know when/where it fails:

#include <GDIPlus.au3>
#include <Array.au3>
#include <File.au3>

_GDIPlus_Startup()

Global Const $sFolder = "C:\ItemsbyName\240x240\Organic"

Global $FileList = _FileListToArray($sFolder, "*", $FLTA_FILES)
If @error Then
    ConsoleWrite('_FileListToArray error: ' & @error & @CRLF)
    Exit
EndIf
Global $Total = $FileList[0]
ConsoleWrite('$Total: ' & $Total & @CRLF)

If FileExists($sFolder & "\New\") = 0 Then
    DirCreate($sFolder & "\New\")
EndIf

For $i = 1 To $Total
    $Filename = $FileList[$i]
    $Filename3 = "9" & $Filename
    ConsoleWrite('$Filename (' & $i & '/' & $Total & '): ' & $Filename & @CRLF)

    $hImage1 = _GDIPlus_ImageLoadFromFile($sFolder & '\' & $Filename)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageLoadFromFile $hImage1 error: ' & @error & @CRLF)
        Exit
    EndIf
    $hImage2 = _GDIPlus_ImageLoadFromFile(@DesktopDir & "\organic.png")
    If @error Then
        ConsoleWrite('_GDIPlus_ImageLoadFromFile $hImage2 error: ' & @error & @CRLF)
        Exit
    EndIf
    $hGraphics1 = _GDIPlus_ImageGetGraphicsContext($hImage1)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageGetGraphicsContext error: ' & @error & @CRLF)
        Exit
    EndIf

    _GDIPlus_GraphicsDrawImage($hGraphics1, $hImage2, 0, 0)
    If @error Then
        ConsoleWrite('_GDIPlus_GraphicsDrawImage error: ' & @error & @CRLF)
        Exit
    EndIf

    _GDIPlus_ImageSaveToFile($hImage1, $sFolder & "\New\" & $Filename3)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageSaveToFile error: ' & @error & @CRLF)
        Exit
    EndIf

    _GDIPlus_GraphicsDispose($hGraphics1)
    If @error Then
        ConsoleWrite('_GDIPlus_GraphicsDispose error: ' & @error & @CRLF)
        Exit
    EndIf
    _GDIPlus_ImageDispose($hImage1)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageDispose($hImage1) error: ' & @error & @CRLF)
        Exit
    EndIf
    _GDIPlus_ImageDispose($hImage2)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageDispose($hImage2) error: ' & @error & @CRLF)
        Exit
    EndIf
Next

_GDIPlus_Shutdown()

As Danp2 mentioned $FileList[0] contains the number of records, or if you use UBound you need to do -1 since arrays start at 0, not 1.

I also moved _GDIPlus_Shutdown() out of the loop, since you don't need to be shutting it down each loop (especially since you're not explicitly starting it, though I think most GDI functions check if it's started).

Give that a run, and see how it processes, look at the console to see what file it's on. (I disabled all the GDIPlus stuff and ran it myself against my Downloads folder and it logged everything in there with no errors)

 

Edit: You may want to also either delete or move the file that you've just processed out of the folder you're scanning, so you don't accidentally process it multiple times

Turns out it was the _GDIPlus_Shutdown() out of the loop that allowed it to complete properly!  Thank you for the suggestion!!

Link to comment
Share on other sites

I was bored and tinkered with your script a bit more yesterday. Check it out, adding some comments:
 

#include <GDIPlus.au3>
#include <Array.au3>
#include <File.au3>
#include <FileConstants.au3>

Global Const $sFolder = "C:\ItemsbyName\240x240\Organic\"
;~ Global Const $sFolder = "C:\Users\Raven\Downloads\"
Global $hOverlayImage = 0, $hImage1 = 0, $hGraphics1 = 0
Global $aFileList
Global $iTotalFiles = 0, $iFilesProcessed = 0
Global $sFilename = '', $sNewFilename = '', $sNewFolder = '', $sDoneFolder = ''
Global $bOverwriteNewFiles = False

; Load files to process. If not all files in the folder are images, you may want to limit to *.png, *.jpg, or whatever type of images they are
$aFileList = _FileListToArray($sFolder, "*.*", $FLTA_FILES)
If @error Then
    ConsoleWrite('_FileListToArray error: ' & @error & ', ' & @extended & ', exiting' & @CRLF)
    Exit
EndIf
; Get the total count of files
$iTotalFiles = $aFileList[0]
If $iTotalFiles <= 0 Then
    ConsoleWrite('No files to process, exiting' & @CRLF)
    Exit
EndIf
ConsoleWrite('$iTotalFiles: ' & $iTotalFiles & ' in path: ' & $sFolder & @CRLF)

; Make sure the folder exists to put processed files into
$sNewFolder = $sFolder & "New\"
If FileExists($sNewFolder) = 0 Then
    If DirCreate($sNewFolder) = 0 Then
        ConsoleWrite('Unable to create new directory: ' & $sNewFolder & ', exiting' & @CRLF)
        Exit
    EndIf
EndIf
; Create a folder to put the original files into that have been successfully processed
$sDoneFolder = $sFolder & "Processed\"
If FileExists($sDoneFolder) = 0 Then
    If DirCreate($sDoneFolder) = 0 Then
        ConsoleWrite('Unable to create processed/done directory: ' & $sDoneFolder & ', exiting' & @CRLF)
        Exit
    EndIf
EndIf

; Register our exit function so we can be sure the GDIPlus_Shutdown is called incase it's forgotten later
;~ OnAutoItExitRegister('__Exit') ; Register an exit function to process GDIPlus_Shutdown and dispose of objects

; Startup GDIPlus
_GDIPlus_Startup()
If @error Then
    ConsoleWrite('_GDIPlus_Startup failed, error: ' & @error & ', ' & @extended & ', exiting' & @CRLF)
    Exit
EndIf

; Open our overlay image. We only need to load it once, then we can just keep using it, don't need to open it each time
$hOverlayImage = _GDIPlus_ImageLoadFromFile(@DesktopDir & "\organic.png")
If @error Then
    ConsoleWrite('_GDIPlus_ImageLoadFromFile $hOverlayImage error: ' & @error & ', ' & @extended & ', exiting' & @CRLF)
    Exit
EndIf

; Loop through each image
For $iFile = 1 To $iTotalFiles
    ; Dispose of any opened graphics/ images from the previous loop and reset them to 0
    _DisposeObjects($hGraphics1, $hImage1)

    $sFilename = $aFileList[$iFile] ; Store in a variable so we don't have to keep accessing the array
    $sNewFilename = "9" & $sFilename ; Set up the new file name
    ConsoleWrite('$sFilename (' & $iFile & '/' & $iTotalFiles & ' - ' & Round(($iFile / $iTotalFiles) * 100, 2) & '%): ' & $sFilename & @CRLF) ; Show our progress
    ; Skip processing the file if a copy already exists in our destination folder
    If $bOverwriteNewFiles = False And FileExists($sNewFolder & $sNewFilename) = 1 Then
        ConsoleWrite('Image already exists, skipping: ' & $sNewFolder & $sNewFilename & @CRLF)
        FileMove($sFolder & $sFilename, $sDoneFolder & $sFilename, $FC_CREATEPATH) ; Move the file out of the processing folder
        ContinueLoop
    EndIf

    ; Open the image to process
    $hImage1 = _GDIPlus_ImageLoadFromFile($sFolder & $sFilename)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageLoadFromFile $hImage1 error: ' & @error & ', ' & @extended & @CRLF)
        ContinueLoop
    EndIf
    ; Create a GraphicsContext
    $hGraphics1 = _GDIPlus_ImageGetGraphicsContext($hImage1)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageGetGraphicsContext error: ' & @error & ', ' & @extended & @CRLF)
        ContinueLoop
    EndIf

    ; Draw our overlay image at 0, 0
    _GDIPlus_GraphicsDrawImage($hGraphics1, $hOverlayImage, 0, 0)
    If @error Then
        ConsoleWrite('_GDIPlus_GraphicsDrawImage error: ' & @error & ', ' & @extended & @CRLF)
        ContinueLoop
    EndIf

    ; Save the new image with the overlay
    _GDIPlus_ImageSaveToFile($hImage1, $sNewFolder & $sNewFilename)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageSaveToFile error: ' & @error & ', ' & @extended & @CRLF)
    Else
        ; Move the processed file out of the main folder so that if we run it again we don't process the same image twice
        FileMove($sFolder & $sFilename, $sDoneFolder & $sFilename, $FC_CREATEPATH)
        If @error Then
            ConsoleWrite('FileMove error: ' & @error & ', ' & @extended & @CRLF)
            ContinueLoop
        EndIf
    EndIf

    ; Keep a count of how many we processed, just for logging sake
    $iFilesProcessed += 1
Next

; Tell us how many files we processed
ConsoleWrite('Files processed: ' & $iFilesProcessed & '/' & $iTotalFiles & ' - ' & Round(($iFilesProcessed / $iTotalFiles) * 100, 2) & '% ' & @CRLF)
; Final cleanup and exit
__Exit()

Func _DisposeObjects(ByRef $hGraphicsToDispose, ByRef $hImageToDispose)
    ; Variables are passed ByRef, so any changes we make to them in here are applied to the original variable, not a local copy
    ; Dispose Graphic object
    If Not ($hGraphicsToDispose = 0) Then
        _GDIPlus_GraphicsDispose($hGraphicsToDispose)
        If @error Then
            ConsoleWrite('_GDIPlus_GraphicsDispose error: ' & @error & ', ' & @extended & @CRLF)
        EndIf
    EndIf
    ; Dispose Image object
    If Not ($hImageToDispose = 0) Then
        _GDIPlus_ImageDispose($hImageToDispose)
        If @error Then
            ConsoleWrite('_GDIPlus_ImageDispose error: ' & @error & ', ' & @extended & @CRLF)
        EndIf
    EndIf

    ; Reset to 0 so that if they're not opened on the next run we don't try to Dispose of nothing
    $hGraphicsToDispose = 0
    $hImageToDispose = 0
EndFunc   ;==>_DisposeObjects

Func __Exit()
    ConsoleWrite('__Exit()' & @CRLF)

    ; Close our overlay image if it was opened
    If Not ($hOverlayImage = 0) Then _GDIPlus_ImageDispose($hOverlayImage)
    $hOverlayImage = 0
    ; Close any remaining objects
    _DisposeObjects($hGraphics1, $hImage1)
    ; Shutdown GDIPlus
    _GDIPlus_Shutdown()

    ; Exit the script
    Exit
EndFunc   ;==>__Exit

I didn't confirm that the GDIPlus stuff still works, but I don't see why it shouldn't, I didn't change a lot of that.

I also recommend that you check out a couple of AutoIt resources, such as:

Edited by mistersquirrle

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

On 2/28/2023 at 11:38 AM, mistersquirrle said:

I was bored and tinkered with your script a bit more yesterday. Check it out, adding some comments:
 

#include <GDIPlus.au3>
#include <Array.au3>
#include <File.au3>
#include <FileConstants.au3>

Global Const $sFolder = "C:\ItemsbyName\240x240\Organic\"
;~ Global Const $sFolder = "C:\Users\Raven\Downloads\"
Global $hOverlayImage = 0, $hImage1 = 0, $hGraphics1 = 0
Global $aFileList
Global $iTotalFiles = 0, $iFilesProcessed = 0
Global $sFilename = '', $sNewFilename = '', $sNewFolder = '', $sDoneFolder = ''
Global $bOverwriteNewFiles = False

; Load files to process. If not all files in the folder are images, you may want to limit to *.png, *.jpg, or whatever type of images they are
$aFileList = _FileListToArray($sFolder, "*.*", $FLTA_FILES)
If @error Then
    ConsoleWrite('_FileListToArray error: ' & @error & ', ' & @extended & ', exiting' & @CRLF)
    Exit
EndIf
; Get the total count of files
$iTotalFiles = $aFileList[0]
If $iTotalFiles <= 0 Then
    ConsoleWrite('No files to process, exiting' & @CRLF)
    Exit
EndIf
ConsoleWrite('$iTotalFiles: ' & $iTotalFiles & ' in path: ' & $sFolder & @CRLF)

; Make sure the folder exists to put processed files into
$sNewFolder = $sFolder & "New\"
If FileExists($sNewFolder) = 0 Then
    If DirCreate($sNewFolder) = 0 Then
        ConsoleWrite('Unable to create new directory: ' & $sNewFolder & ', exiting' & @CRLF)
        Exit
    EndIf
EndIf
; Create a folder to put the original files into that have been successfully processed
$sDoneFolder = $sFolder & "Processed\"
If FileExists($sDoneFolder) = 0 Then
    If DirCreate($sDoneFolder) = 0 Then
        ConsoleWrite('Unable to create processed/done directory: ' & $sDoneFolder & ', exiting' & @CRLF)
        Exit
    EndIf
EndIf

; Register our exit function so we can be sure the GDIPlus_Shutdown is called incase it's forgotten later
;~ OnAutoItExitRegister('__Exit') ; Register an exit function to process GDIPlus_Shutdown and dispose of objects

; Startup GDIPlus
_GDIPlus_Startup()
If @error Then
    ConsoleWrite('_GDIPlus_Startup failed, error: ' & @error & ', ' & @extended & ', exiting' & @CRLF)
    Exit
EndIf

; Open our overlay image. We only need to load it once, then we can just keep using it, don't need to open it each time
$hOverlayImage = _GDIPlus_ImageLoadFromFile(@DesktopDir & "\organic.png")
If @error Then
    ConsoleWrite('_GDIPlus_ImageLoadFromFile $hOverlayImage error: ' & @error & ', ' & @extended & ', exiting' & @CRLF)
    Exit
EndIf

; Loop through each image
For $iFile = 1 To $iTotalFiles
    ; Dispose of any opened graphics/ images from the previous loop and reset them to 0
    _DisposeObjects($hGraphics1, $hImage1)

    $sFilename = $aFileList[$iFile] ; Store in a variable so we don't have to keep accessing the array
    $sNewFilename = "9" & $sFilename ; Set up the new file name
    ConsoleWrite('$sFilename (' & $iFile & '/' & $iTotalFiles & ' - ' & Round(($iFile / $iTotalFiles) * 100, 2) & '%): ' & $sFilename & @CRLF) ; Show our progress
    ; Skip processing the file if a copy already exists in our destination folder
    If $bOverwriteNewFiles = False And FileExists($sNewFolder & $sNewFilename) = 1 Then
        ConsoleWrite('Image already exists, skipping: ' & $sNewFolder & $sNewFilename & @CRLF)
        FileMove($sFolder & $sFilename, $sDoneFolder & $sFilename, $FC_CREATEPATH) ; Move the file out of the processing folder
        ContinueLoop
    EndIf

    ; Open the image to process
    $hImage1 = _GDIPlus_ImageLoadFromFile($sFolder & $sFilename)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageLoadFromFile $hImage1 error: ' & @error & ', ' & @extended & @CRLF)
        ContinueLoop
    EndIf
    ; Create a GraphicsContext
    $hGraphics1 = _GDIPlus_ImageGetGraphicsContext($hImage1)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageGetGraphicsContext error: ' & @error & ', ' & @extended & @CRLF)
        ContinueLoop
    EndIf

    ; Draw our overlay image at 0, 0
    _GDIPlus_GraphicsDrawImage($hGraphics1, $hOverlayImage, 0, 0)
    If @error Then
        ConsoleWrite('_GDIPlus_GraphicsDrawImage error: ' & @error & ', ' & @extended & @CRLF)
        ContinueLoop
    EndIf

    ; Save the new image with the overlay
    _GDIPlus_ImageSaveToFile($hImage1, $sNewFolder & $sNewFilename)
    If @error Then
        ConsoleWrite('_GDIPlus_ImageSaveToFile error: ' & @error & ', ' & @extended & @CRLF)
    Else
        ; Move the processed file out of the main folder so that if we run it again we don't process the same image twice
        FileMove($sFolder & $sFilename, $sDoneFolder & $sFilename, $FC_CREATEPATH)
        If @error Then
            ConsoleWrite('FileMove error: ' & @error & ', ' & @extended & @CRLF)
            ContinueLoop
        EndIf
    EndIf

    ; Keep a count of how many we processed, just for logging sake
    $iFilesProcessed += 1
Next

; Tell us how many files we processed
ConsoleWrite('Files processed: ' & $iFilesProcessed & '/' & $iTotalFiles & ' - ' & Round(($iFilesProcessed / $iTotalFiles) * 100, 2) & '% ' & @CRLF)
; Final cleanup and exit
__Exit()

Func _DisposeObjects(ByRef $hGraphicsToDispose, ByRef $hImageToDispose)
    ; Variables are passed ByRef, so any changes we make to them in here are applied to the original variable, not a local copy
    ; Dispose Graphic object
    If Not ($hGraphicsToDispose = 0) Then
        _GDIPlus_GraphicsDispose($hGraphicsToDispose)
        If @error Then
            ConsoleWrite('_GDIPlus_GraphicsDispose error: ' & @error & ', ' & @extended & @CRLF)
        EndIf
    EndIf
    ; Dispose Image object
    If Not ($hImageToDispose = 0) Then
        _GDIPlus_ImageDispose($hImageToDispose)
        If @error Then
            ConsoleWrite('_GDIPlus_ImageDispose error: ' & @error & ', ' & @extended & @CRLF)
        EndIf
    EndIf

    ; Reset to 0 so that if they're not opened on the next run we don't try to Dispose of nothing
    $hGraphicsToDispose = 0
    $hImageToDispose = 0
EndFunc   ;==>_DisposeObjects

Func __Exit()
    ConsoleWrite('__Exit()' & @CRLF)

    ; Close our overlay image if it was opened
    If Not ($hOverlayImage = 0) Then _GDIPlus_ImageDispose($hOverlayImage)
    $hOverlayImage = 0
    ; Close any remaining objects
    _DisposeObjects($hGraphics1, $hImage1)
    ; Shutdown GDIPlus
    _GDIPlus_Shutdown()

    ; Exit the script
    Exit
EndFunc   ;==>__Exit

I didn't confirm that the GDIPlus stuff still works, but I don't see why it shouldn't, I didn't change a lot of that.

I also recommend that you check out a couple of AutoIt resources, such as:

This works great! Thank you, makes a lot more sense than what I had written.  All the comments will be useful down the road!  I had over 2000 pictures to add a logo to the bottom corner, this method did it in seconds, but would have taken days going one-by-one.  

Link to comment
Share on other sites

No problem, I don't know what capacity you're using this in but if it's for a business and you or someone on your team may be re-using it I would suggest taking a look at making it a bit more flexible in use. Use something like InputBox or IniRead/Write to ask the user what folders to use or allow them to configure them. This way you could compile the script and send it to someone else to allow them to process files on their computer without them having to edit the script or create the folders like you have it set up.

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...