Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sabotage79

macrumors newbie
Original poster
Nov 22, 2006
18
0
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:
lsof | grep "Photos Library.photoslibrary/private/com.apple.cloudphotosd/CloudSync.noindex/Engine/filecache"

H7RTIu1.png


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!
 
Last edited:

kryten2

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
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.
 

sabotage79

macrumors newbie
Original poster
Nov 22, 2006
18
0
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.
rcDwMxZ.png


Any suggestions?

edit:

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

PnQxw7M.png
 
Last edited:

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,425
A sea of green
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.