ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Automagic Digital Photo Manager

<< < (2/4) > >>

oblivion:
Something simple in PowerShell while skwire whips up a masterpiece :P : DCIMover.ps1
-4wd (October 23, 2018, 05:36 PM)
--- End quote ---
That's awesome, thanks!

I won't be able to get access to their PC again for a few days but I gave them a USBsafelyRemove license I no longer need to handle the autoplay side of things and between the two, it should be perfect -- thanks again!

oblivion:

--- ---#region gui events {
$Button1.Add_Click({
  $objForm = New-Object System.Windows.Forms.FolderBrowserDialog
  $objForm.Description = "Destination folder"
  $objForm.SelectedPath = [System.Environment+SpecialFolder]'MyComputer'
  $objForm.ShowNewFolderButton = $false
  $result = $objForm.ShowDialog()
  if ($result -eq "OK") {
    $TextBox1.Text = $objForm.SelectedPath
  } else {
    $TextBox1.Text = ""
  }
})-4wd (October 23, 2018, 05:36 PM)
--- End quote ---

Just one quick question: if I wanted to modify this bit to a specific root destination folder (eg c:\users\fred\pictures\photos) would I just change this line


--- ---$objForm.SelectedPath = [System.Environment+SpecialFolder]'MyComputer'
or is it more complicated than that? (I really want to make it as simple as I can for him!)

4wd:
Just one quick question: if I wanted to modify this bit to a specific root destination folder (eg c:\users\fred\pictures\photos) would I just change this line


--- ---$objForm.SelectedPath = [System.Environment+SpecialFolder]'MyComputer'
or is it more complicated than that? (I really want to make it as simple as I can for him!)
-oblivion (October 27, 2018, 04:23 PM)
--- End quote ---

If you want an absolute location change it to:

--- ---$objForm.SelectedPath = 'c:\users\fred\pictures\photos'
The [System.Environment+SpecialFolder] is due to My Computer being classed as a special folder, (like 'Documents', 'Pictures', etc).

I've just updated it using a different file properties function and added the ability to handle the following filetypes:
.jpg, .dng (Canon Raw), .mov, .mp4, .avi

For JPEG and DNG it'll use the Date Taken value, for the video files it'll use Date Created.

Easy enough to add other filetypes if you want something specific to a camera.

Also changed the month folder names to xx_ABC, eg. 05_May, so it lists the months in calendar order rather than alphabetical.

Added a progress bar, still can't interrupt it as it works but at least it shows it's doing something ... maybe.

Now to work out how runspaces work.

Updated

oblivion:
I've just updated it
-4wd (October 27, 2018, 11:02 PM)
--- End quote ---
Well, I took it over tonight; put it and the shortcuts in c:\utilities\dcimover, modified the relevant line with the absolute path, set up the relevant bits to autorun the shortcut on insertion, and I just got a Powershell window with nothing in it.

Some more experimentation later and I managed to start the GUI -- by running the script directly, I think -- but it threw some scary-looking errors when I hit the Move button.

It did something -- the test pictures I'd put on the card disappeared -- but I couldn't work out what.

And, of course, as I'd spent several hours trying to solve a completely unrelated problem on the computer that I was completely unprepared for, by the time I got to this point I didn't have time to do all the testing I'd have liked. :(

Now I'm away from it, it occurs to me to wonder if I'd just left a terminating backslash off the path, or included one when I shouldn't have, or something else obvious, but I probably won't be able to look for another week...

4wd:
Well, I took it over tonight; put it and the shortcuts in c:\utilities\dcimover, modified the relevant line with the absolute path, set up the relevant bits to autorun the shortcut on insertion, and I just got a Powershell window with nothing in it.-oblivion (October 28, 2018, 06:14 PM)
--- End quote ---

Forgot to mention, the shortcut needs to be in the same place as the script otherwise you need to add the full path to it in the shortcut Target field.

What OS are we looking at?

Some more experimentation later and I managed to start the GUI -- by running the script directly, I think -- but it threw some scary-looking errors when I hit the Move button.
--- End quote ---

Did you run it with ExecutionPolicy set to Bypass?

Because it was downloaded it will be marked by Windows as coming from another computer which can block it from running or lower it's access to a folder.

Run it with the following command from a PowerShell console:


--- Code: Text ---%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -sta -noprofile -executionpolicy bypass -File "DCIMover-GUI.ps1"
You can then copy/paste the error messages in the console.

Also, what version of PowerShell, do you know?
Next time you're there type $PSVersionTable in the PowerShell console which will give the version number, I don't think there's anything version specific in the script.

It did something -- the test pictures I'd put on the card disappeared -- but I couldn't work out what.
--- End quote ---

Well, it moved them somewhere otherwise they'd still be there ;)

The error messages will help a lot.

Now I'm away from it, it occurs to me to wonder if I'd just left a terminating backslash off the path, or included one when I shouldn't have, or something else obvious, but I probably won't be able to look for another week...
--- End quote ---

No terminating backslash required on the path.

You can't try it on your computer?

Thanks for giving it a go.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version