Skip navigation

get last group of images and open with app.

416 Views 5 Replies Latest reply: Oct 18, 2012 8:21 AM by Jacques Rioux RSS
MattJayC Level 1 Level 1 (0 points)
Currently Being Moderated
Oct 12, 2012 6:34 AM

What I would like to do is take a series of images, and then open this series of images into helicon focus where it then merges the images together.

 

I'm hoping that with applescript. I can get the open the last set of images (jpg only, PSD's arrive in the same folder and don't need to be recognised) . That are shot within the 2 minutes. I have the script below might begin to help me. although I need it to select all of the images shot in the last minute. Then open with helicon Focus (that is not scriptable) i'll use system events from there.

 

It will need to run the script when there are no new files after 30 seconds then group all the images togethe and hightlight and open.

 

 

 

Can this be adapted?

 

 

 

try

          tell application "Finder" to set currFolder to front Finder window -- get id of front Finder window

on error

          return -- no Finder window

end try

 

 

set tDate to (current date) - 60

repeat

          set b to false

          try

                    tell application "Finder"

                              repeat with i in (get document files of currFolder whose creation date > tDate) -- get newer files

                                        if (exists currFolder) then

                                                  reveal i

                                                  my selectionfullScreen()

                                                  set cDate to creation date of i

                                                  if cDate > tDate then set tDate to cDate -- store newer date

                                                  set b to true

                                        end if

                              end repeat

                    end tell

          on error number n

                    if n = -1728 then return --quit the script, the current Folder is closed

          end try

          if not b then delay 2 -- no recent files, wait 2 seconds

end repeat

iMac, Mac OS X (10.6.8)
  • Jacques Rioux Level 4 Level 4 (1,925 points)
    Currently Being Moderated
    Oct 12, 2012 10:13 AM (in response to MattJayC)

    Hi,

     

    If I understood everything, this script should do what you want :

    -------------------------

    try

          tell application "Finder" to set currFolder to front Finder window -- get id of the front Finder window

    on error

          return -- no Finder window

    end try

     

    set tDate to (current date)

    repeat

          set b to false

          repeat -- loop to wait until there are no new images

                try

                      set currDate to current date

                      tell application "Finder" to document files of currFolder whose name extension is "jpg" and creation date > tDate

                      if the result is not {} then -- newer image(s)

                            set tDate to currDate

                            set b to true

                      else if b and (current date) - tDate > 29 then -- no new image from the last thirty seconds.

                            set tDate to currDate

                           

                            tell application "Finder" -- get images shot in the last 120 secs.

                                  set tFiles to (document files of currFolder whose name extension is "jpg" and creation date > (currDate - 120)) as alias list

                                  select tFiles

                            end tell

                            activate application "Helicon Focus"

                            delay 0.2 -- adjust the time if necessary.

                            tell application "System Events"

                                  tell process "Helicon Focus" to keystroke "c" using {command down, option down}

                            end tell

                            delay 1

                            tell application "Helicon Focus" to open tFiles

                            delay 2 -- to allow time for the application to display the files in the window. (adjust the time if necessary.)

                            tell application "System Events"

                                  tell process "Helicon Focus" to keystroke "g" using command down

                            end tell

                            exit repeat

                      end if

                on error number n

                      if n = -1728 then return --quit the script, the current Folder is closed

                end try

                delay 2 -- wait before checking the new file.

          end repeat

          delay 10 -- waiting time after the images are opened in "Helicon Focus" to allow time for the user.

    end repeat

    -------------------------

  • Jacques Rioux Level 4 Level 4 (1,925 points)
    Currently Being Moderated
    Oct 18, 2012 8:21 AM (in response to MattJayC)

    This is possible by checking that the menu "Save ..." is enabled, or by checking the ("render" button or progress bar) in the window.

     

    I don't know about the latest version of the application, but this works on version 4.2.4

    -----------------

    tell application "System Events"

          tell process "Helicon Focus"

                keystroke "g" using command down -- render images

                tell menu item "Save Image…" of menu "File" of menu bar 1 to repeat

                      delay 1.5

                      if enabled then

                            click -- to save the image

                            exit repeat

                      end if

                end repeat

          end tell

    end tell

    -----------------

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.