Lightroom export File processing

Hi There,
I am trying to make a program that I can run after exporting images from Lightroom - hopefully it will produce two copies of the images of different sizes and run them through a Photoshop Droplet to do a little bit of sharpening etc.

I am able to get the program to run if I drop a folder of images onto a droplet, but have been unable to work out the process when they are exported from Lightroom. They enter the program as a list of files instead of a folder.


property PathToAssets : ((path to home folder) as string) & "Pictures:RBRAssets"

on open these_files -- use this to make a script that isn't a folder action
	
	tell application "Finder"		
		set HighResDroplet to application file (PathToAssets & ":Droplets:HighRes Auto")
		open these_files using HighResDroplet
		
		delay 5 -- to allow photogshop to get up and running before proceeding to next phase of script
		
		display dialog "Processes High Res Droplet"
		
		set the_file to file these_files
		set files_folder to container of the_file

		set WebResFolderName to ("Web Res") as text
		make new folder at files_folder with properties {name:WebResFolderName}
		set WebResFolder to ((files_folder as text) & WebResFolderName)
		
		duplicate every file of folder files_folder to folder WebResFolder
		
	end tell
end open

I have never written a ‘on open’ script and have been using a folder action. So I am learning (trying to anyhow) how to do things differently.

The script above ends up giving me the error message:

Finder got an error: Can’t make {alias “pate:Users:path:Pictures:Lightroom Exports:Property Images:Property Address_8229.jpg”} into type integer. (-1700)

I have tried to work with POSIX instead and have also tried to define the files as files rather than aliases but haven’t managed to sort the issue.

I am also getting a splash screen when the script starts that asks me if I want to run the script/program, how do I stpr that happening?

Many thanks in advance for any help.

Rob

I am running OSx 10.11.5 El Capitan with whatever version of AppleScript that has.

Hi Again.
I have managed to solve most of my immediate issues. I can now make a copy of the images in a new folder - soon to be resized by the next part of the script.

I am still a bit confused as to why the script gives a splash screen when the script starts that asks me if I want to run the script/program, how do I stop that happening?

The updated script is as follows:



property PathToAssets : ((path to home folder) as string) & "Pictures:RBRAssets"

on open these_files
	tell application "Finder"
		-- Start by processing all images with the high res photoshop droplet
		
		set HighResDroplet to application file (PathToAssets & ":Droplets:HighRes Auto")
		open these_files using HighResDroplet
		
		delay 5 -- to allow photogshop to get up and running before proceeding to next phase of script

		set FirstFile to item 1 of these_files
		
		set files_folder to container of FirstFile
		
		set WebResFolderName to ("Web Res") as text
		make new folder at files_folder with properties {name:WebResFolderName}
		set WebResFolder to ((files_folder as text) & WebResFolderName)

		
		-- need to use a droplet that saves and closes
		duplicate these_files to folder WebResFolder
		-- now to use the scale command to resize the images in the new folder 
		
	end tell
	
	
	-- end adding folder items to
end open