divide pic into two sub-folders according to content in name...

This area contains the messages from the old Yahoo gcmac group after the port.
petri71
Posts: 0
Joined: Sat Dec 28, 2013 6:20 am

divide pic into two sub-folders according to content in name...

Post by petri71 »

Hello,I use a camera (Lumia 1020) that is giving two kinds of photo for each shot... but it's the same format. The difference is the size and the name, the big one has "highres" in the name of the picture...I would like to have an script within GC that would divide the lowers from the highres and move them in different subfolders of the one they are in.How could I do that ? Do I have to write a script ? if yes, could anyone help me with the content ? I really suck at this.Otherwise is there a place I can customize the move into folders options ?Thank you in advance for your answersPetri
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: divide pic into two sub-folders according to content in name...

Post by thorstenlemke »

Attachments :Hello Petri,do they maybe have different names/extensions?Thorsten Hello,I use a camera (Lumia 1020) that is giving two kinds of photo for each shot... but it's the same format. The difference is the size and the name, the big one has "highres" in the name of the picture...I would like to have an script within GC that would divide the lowers from the highres and move them in different subfolders of the one they are in.How could I do that ? Do I have to write a script ? if yes, could anyone help me with the content ? I really suck at this.Otherwise is there a place I can customize the move into folders options ?Thank you in advance for your answersPetri
petri71
Posts: 0
Joined: Sat Dec 28, 2013 6:20 am

Re: divide pic into two sub-folders according to content in name...

Post by petri71 »

Hello Thorsten,no they both have the same extension and just part of the name is differentex :WP_20140801_12_38_51_Pro.jpgWP_20140801_12_38_51_Pro__highres.jpg
petri71
Posts: 0
Joined: Sat Dec 28, 2013 6:20 am

Re: divide pic into two sub-folders according to content in name...

Post by petri71 »

well it looks like GC will not be able to do it for me...So I have tried to customize an old script of mine but can't make it work :---------property _subfolder_hr : "HighRes" tell application "Finder" set _slidefolder to choose folder set HighResfolder to make new folder at _slidefolder with properties {name:_subfolder_hr} move (get files of _slidefolder whose name contains "highres") to HighResfolder end tell--------could anybody help or point me in the direction of a good forum where I could find the help ?Thank you
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: divide pic into two sub-folders according to content in name...

Post by thorstenlemke »

Hello Petri,I have no solution for this special case, yet.Thorsten no they both have the same extension and just part of the name is differentex :WP_20140801_12_38_51_Pro.jpgWP_20140801_12_38_51_Pro__highres.jpg
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: divide pic into two sub-folders according to content in name...

Post by Brian Christmas »

G'dayTryproperty _subfolder_hr : "HighRes"tell application "Finder" set _slidefolder to choose folder make new folder at _slidefolder with properties {name:_subfolder_hr} set pathToHighResFolder to _slidefolder & _subfolder_hr as text move (get files of _slidefolder whose name contains "highres") to folder pathToHighResFolderend tellRegardsBrian
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: divide pic into two sub-folders according to content in name...

Post by Brian Christmas »

I thought that you might want to run your moving script more than once, and my original post would cause an error, so I've modified it.property _subfolder_hr : "HighRes"tell application "Finder" set _slidefolder to choose folder set pathToHighResFolder to _slidefolder & _subfolder_hr as text if not (exists folder pathToHighResFolder) then make new folder at _slidefolder with properties {name:_subfolder_hr} move (get files of _slidefolder whose name contains "highres") to folder pathToHighResFolderend tellRegardsBrian
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: divide pic into two sub-folders according to content in name...

Post by Brian Christmas »

I've read your first post, and realized that you don't really know about Applescript.So, I thought you might find it a lot easier to have an application on your desktop to do the moving, rather than opening and running a script.Open the script below in Applescript editor.Save it as 'Save as' and call it whatever name you desire, as  an Application, on your desktop.Then simply double click the new app.RegardsBrianproperty _subfolder_hr : "HighRes"on run tell application "Finder" set _slidefolder to choose folder set pathToHighResFolder to _slidefolder & _subfolder_hr as text if not (exists folder pathToHighResFolder) then make new folder at _slidefolder with properties {name:_subfolder_hr} move (get files of _slidefolder whose name contains "highres") to folder pathToHighResFolder end tellend run
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: divide pic into two sub-folders according to content in name...

Post by Christopher Stone »

On Aug 06, 2014, at 01:27, petri71@yahoo.com [gcmac] <gcmac@yahoogroups.com> wrote: Well it looks like GC will not be able to do it for me...______________________________________________________________________Hey Petri,I'm assuming you're starting with a browser window open in GraphicConverter - yes?The following script uses the same basic ideas as your original and Brian's mod but adds some goodies and error-checking.It will present a choose-from dialog that originates at the folder open in the browser window.  If no browser window is open the dialog will use the Desktop as its origin.Personally I would always start with a browser window and eliminate the choose-from dialog, but YMMV.I would also run this from FastScripts or Keyboard Maestro, because it's easier to set keyboard shortcut from them, but I already own both utilities.  That said it's not terribly difficult to use the System Keyboard Prefs to add a keyboard shortcut for a script in GC's script menu.* I have tested this script on 10.9.4 from GC's own script menu and from FastScripts.--Best Regards,ChrisP.S.  Brian: Remember that Finder-References are slooow...-------------------------------------------------------------------------------------------# Auth: Christopher Stone <listmeister@thestoneforge.com># dCre: 2014-08-06 : 11:45# dMod: 2014-08-06 : 11:58 # Appl: Finder, GraphicConverter 9# Task: Move hiRez files to subfolder of original starting at folder in GC Browser.#     : If a browser is not open in GC the starting point will move to the desktop.# Libs: None# Osax: None# Tags: @Applescript, @Script, @Finder, @GraphicConverter_9, @Move, @Files-------------------------------------------------------------------------------------------try    tell application "GraphicConverter 9"    tell front window      set srcFldr to its file as text    end tell  end tell    if srcFldr does not end with ":" then    set srcFldr to path to desktop as text  end if    set srcFldr to choose folder default location alias srcFldr  tell application "Finder"    set aliasList to (files of srcFldr whose name contains "_highres.jpg") as alias list    if length of aliasList > 0 then      set destFldr to (srcFldr as text) & "HighRes:"      try        set destFldr to alias destFldr      on error        set destFldr to (make new folder at srcFldr with properties {name:"HighRes"}) as alias      end try      move aliasList to destFldr    end if  end tell  on error e number n  set e to e & return & return & "Num: " & n  tell current application to set dDlg to display dialog e with title "ERROR!" buttons {"Cancel", "Copy", "OK"} default button "OK"  if button returned of dDlg = "Copy" then set the clipboard to eend try-------------------------------------------------------------------------------------------
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: divide pic into two sub-folders according to content in name...

Post by Christopher Stone »

This one removes the choose-folder code and operates directly on the folder open in the front GC Browser Window.--Best Regards,Chris-------------------------------------------------------------------------------------------# Auth: Christopher Stone# dCre: 2014/08/06 11:45# dMod: 2014/08/06 12:59# Appl: Finder, GraphicConverter 9# Task: Move hiRez files to subfolder of original starting at folder in front GC Browser.# Libs: None# Osax: None# Tags: @Applescript, @Script, @Finder, @GraphicConverter_9, @Move, @Files-------------------------------------------------------------------------------------------try    tell application "GraphicConverter 9"    tell front window      set srcFldr to its file as text    end tell  end tell    if srcFldr ends with ":" then    tell application "Finder"      set aliasList to (files of (alias srcFldr) whose name contains "_highres.jpg") as alias list      if length of aliasList > 0 then        set destFldr to (srcFldr as text) & "HighRes:"        try          set destFldr to alias destFldr        on error          set destFldr to (make new folder at srcFldr with properties {name:"HighRes"}) as alias        end try        move aliasList to destFldr      else        error "No HighRez files were found!"      end if    end tell  else    error "A Browser Window Must Be Frontmost! "  end if  on error e number n  set e to e & return & return & "Num: " & n  if n ≠ -128 then    try      tell current application to button returned of ¬        (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬          default button "OK" giving up after 30)      if ddButton = "Copy" then set the clipboard to e    end try  end ifend try-------------------------------------------------------------------------------------------
Post Reply