shell variant instead image capture

I hate open loops or workflows, because for this i’m scripting stuff. Since the “on open” handler is useless for interacting with mounted peripherals (iPod, Photo camera) I need to use other ways to do so.

I thought to use autofsd to check for new external drives, submit everything to automountd and input the result as list in a applescript app I wrote, instead to use the “Image capture.app”. Solely, i’m not practical with shell scripts, thats pity!

nobody around with some suggestions?
maybe automountd might not work, but its a way to try, not?

There’s 2 solutions I can think of, 1) write a cocoa application that runs in the background. Cocoa applications can get notified when disks mount/unmount. 2) write a stay-open applescript application that periodically checks for new disks. Something like this would work for solution 2. I’m not sure if solution 2 is what you mean by “open loops” or not but it would work.

property waitTime : 10

global mountedDisks

on run
	set mountedDisks to missing value
end run

on idle
	set currentDisks to list disks
	
	repeat with aDisk in currentDisks
		if aDisk is not in mountedDisks then
			-- do something with the new disk
		end if
	end repeat
	set mountedDisks to currentDisks
	
	return waitTime
end idle

Hi Hank,
thanks for your answer. I call “open loop” a step, which breaks the continuity of my workflow. (without relationships to Automator)
I admit, oopen loops sounds a bit clumpy (OOoops!)

I don’t want to insist with my first question about automountd, but I thought it could be the best way to go…
since the man pages are soo cryptic for me and better understood from experienced scripters using to deal with ‘higher languages’ too, than only with applescript.

Usually, Image Capture does the job to download images from a external periphery, like a memo-card.
I instead, tried to automate the job, using an applescript application to import and process images in one step, if my camera is plugged in. Unfortunately, the memo card of my camera rests invisible in the finder environment and i’ve to do steps manually with Image Capture. (i’m without iPhoto) Neverthelsee, i’ll try your script.

Mac os seems to import images by telling applications only, (e.g. Image Capture for Images) without to send/pipe any references into the launched application. Since I’ve never used Xcode, there is little I can do to proceed.

Thanks anyway!
:slight_smile: