View current iCloud photo being uploaded

Discussion in 'Mac Programming' started by sabotage79, Apr 23, 2015.

  1. sabotage79, Apr 23, 2015
    Last edited: Apr 23, 2015

    sabotage79 macrumors newbie

    Joined:
    Nov 22, 2006
    #1
    So I have a large iPhotos library. With the new Photos application, i'm taking advantage of the iCloud Photo Library features. This means i'm uploading over 17,000 photos/videos over a 15Mb/760kbps DSL connection.

    So I thought it would be nice to be able to see the current progress of the upload. The follow command in terminal will get you the current images being uploaded:
    [​IMG]

    Thats great! I can navigate to that location and view the images in finder. But, how cool would it be to have a little app or automator script that would display a window with the current image/images being uploaded.

    I found this automator script but it doesn't seam to work for me in Yosemite.:http://apple.stackexchange.com/ques...-folder-and-display-new-images-in-full-screen

    I get the error "Can’t make «class ctnr» of item 1 into type alias."

    Would anyone be willing to help me with an application or script to do this? I hope this will be helpful to others. Thank you!
     
  2. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    What folder is the Folder Action attached to? Looking at the Terminal lsof output I can see two different directories with a jpeg file in it e.g. :

    /Users/.../ASV/
    /Users/.../ASQ/

    You can try this as a test in ScriptEditor :

    Code:
    -- Choose one of folders inside the filecache folder
    set theFolder to choose folder default location (path to pictures folder) with showing package contents
    
    tell application "Finder"
    	set input to (every file of theFolder whose name extension is "jpeg") as alias list
    	set the_folder to container of (item 1 of input) as alias
    	
    	if window 1 exists then
    		set the target of window 1 to the_folder
    	else
    		reveal the_folder
    	end if
    	
    	--Send the Esc key to exit the previous quick-look, if there is one
    	(*
    	tell application "System Events"
    		key code 53
    	end tell
    *)
    	
    	delay (1)
    	
    	--select the new file
    	select item 1 of input as alias
    	activate
    	activate window 1
    	
    	delay (1)
    	
    	--Activate full screen quick look on the selected file
    	tell application "System Events"
    		keystroke "y" using {command down, option down}
    	end tell
    end tell
    
    Note : Quick test done on Mavericks with a jpg file inside one of the subdirectories of the Previews directory of the iPhoto Library directory.
     
  3. sabotage79, Apr 24, 2015
    Last edited: Apr 24, 2015

    sabotage79 thread starter macrumors newbie

    Joined:
    Nov 22, 2006
    #3
    Kryten2,

    I created a folder and put 4 jpg files in it. ~/Pictures/test/
    I then selected that folder for "Folder actions receives files and folders add to"

    Then opened Automator and input your script. I then hit Run and a window pops up wanting me to select a folder. I choose the same folder above. I get the following error:

    Can’t make «class ctnr» of item 1 of {} into type alias.
    [​IMG]

    Any suggestions?

    edit:

    I see you said Script Editor. I get the follow error:

    [​IMG]
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    The list is empty. Therefore, there is no "item 1".

    You can tell the list is empty from the part of the error message I've bolded:
    Can't make <<class ctnr>> of item 1 of { } into alias.

    The { } means an empty list. If the list had anything in it, it would have appeared as { thing_1, thing_2, cat, hat }.


    The line provoking the error is this one:
    Code:
    set the_folder to container of (item 1 of input) as alias
    
    Since 'input' is of type 'alias array', we know it's an array, because of the line before it.

    In short, the code doesn't account for the possibility that no files have an extension of "jpeg", so when that happens, the empty array breaks the line noted above.
     

Share This Page