Move Pictures

Post your working scripts, libraries and tools for AHK v1.1 and older
garry
Posts: 3764
Joined: 22 Dec 2013, 12:50

Move Pictures

22 Feb 2015, 16:28

a small example

Code: Select all

modified=20150222

/* --------- MOVE PICTURES --------------------------
put this script in a folder
downloads small picture black.png
creates 2 Subfolders
-put some pictures to                   SOURCE_TEST
-when click on picture picture moves to MOVED_TEST
*/ --------------------------------------------------


#NoEnv
setworkingdir, %a_scriptdir%
Gui,2:default
Gui,2:Color,black
Gui,2:Font,  S10  , Lucida Console

FormatTime, Suomi , L1035, dddd MMMM yyyy-MM-dd
Filename1=Picture-Move      User=%a_username%        Computer=%a_computername%        %a_osversion%       AHK-Version=%a_ahkversion%       %suomi%

f2=%a_scriptdir%\black.png    ;- replace moved picture with black
ifnotexist,%f2%
     urldownloadtofile,http://i.imgur.com/SLox8Fy.png,%f2%

fd1=%a_scriptdir%\SOURCE_TEST
fd2=%a_scriptdir%\MOVED_TEST
ifnotexist,%fd1%
  filecreatedir,%fd1%
ifnotexist,%fd2%
  filecreatedir,%fd2%

extx:="jpg,bmp,tif,gif,png"
t=0
;---------------------------------------

Gui,2:default

Gui,2:Add,Picture, x10    y5  h600 w800 vP1 gA1,
Gui,2:Add,Picture, x820   y5  h600 w800 vP2 gA1,

Gui,2:add,button, x10 y630 h25 w100 gMoveBack,Move-Back

Gui, 2:Show, x100 y10 w1640 h670,%filename1%
gosub,fillx
return
;----------
2Guiclose:
exitapp
;------------------------------------

a1:
Gui,2:submit,nohide
MouseGetPos,,, winid, ctrl
;msgbox,%ctrl%
;return
    if (ctrl ~= "Static1")
        {
        aaa := a_guicontrol
        aac=%p1%
        p1=
        }

    if (ctrl ~= "Static2")
        {
        aaa := a_guicontrol
        aac=%p2%
        p2=
        }
if (aac="" or aaa="" or ctrl="")
   return
t:=(t+1)
;msgbox, 262208,TEST ,ctrl=%ctrl%`naaa=%aaa%`naac=%aac%`nT=%t%,1
FileMove, %aac%,%fd2%, 0
GuiControl,2:,%aaa%,%f2%
if (t=2)
  {
  t=0
  gosub,fillx
  }
return
;----------------------------


Fillx:
Gui,2:submit,nohide
loop,2
  p%a_index%=
m=0
Loop,%fd1%\*.*,,
   {
   if a_loopfileext in %extx%
     {
     m++
     if (m=3)
        break
     x:= a_loopfilefullpath
     p%a_index%  .= x
     GuiControl,2:, p%m%,%x%
     }
   }
return


MoveBack:
Gui,2:submit,nohide
Loop,%fd2%\*.*,,
   {
   if a_loopfileext in %extx%
     FileMove,%a_loopfilefullpath%,%fd1%,0   ; not overwrite existing files
   }
gosub,fillx
return

;========= END SCRIPT ================================

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: Move Pictures

23 Feb 2015, 04:18

???
Everything is possible!
garry
Posts: 3764
Joined: 22 Dec 2013, 12:50

Re: Move Pictures

23 Feb 2015, 05:52

sorry , at the moment useless
I'll use to select ( move to folder OK / NOT-OK ) and rename my pictures from SD-card ( camera )
maybe show only one picture
other idea was that I combined 9 pictures to one picture in a GUI , then used printscreen

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: gongnl, KruschenZ and 50 guests