Picture Package save as same name

Hello
This is my first script . I have a number of five by seven photo’s (psd) that I run through
picture package in photoshop 7.0.1. I then need to save them to a new folder with the same name (035 to 999) as TIFF files. I figured out how to set my input folder and output folder along with my save options. My problem is that the picture package action is still being saved as (Picture Package ) to my output folder and over writing each photo as
such. I am using a I Book G4 with 10.4.8 Photoshop 7.0.1 and Script editor 2.1.1
any help would be appreciated.

set tempFolderName to "1-ea"
set inputFolder to choose folder
set outputFolder to "Macintosh HD:Users:thomasebl:Desktop:ebl finals:1-ea"

tell application "Finder"
	set filesList to files in inputFolder
	
end tell

tell application "Adobe Photoshop 7.0"
	set display dialogs to never
	close every document saving no
end tell

repeat with aFile in filesList
	
	tell application "Finder"
		
		set theFile to aFile as alias
		set theFileName to name of theFile
	end tell
	
	tell application "Adobe Photoshop 7.0"
		
		open theFile
		
		set docRef to the current document
		
		if (mode of docRef is not RGB) then
			change mode docRef to RGB
		end if
		if (bits per channel of docRef is sixteen) then
			set bits per channel of docRef to eight
		end if
		
		set myOptions to {class:TIFF save options, image compression:none, byte order:Mac OS, save alpha channels:true, save spot colors:true, embed color profile:true}
		set infoRef to get info of docRef
		set docName to name of docRef
		
		do action "D Package" from "test scripts"
		
		save current document in file "Macintosh HD:Users:thomasebl:Desktop:ebl finals:1-ea" as TIFF with options myOptions appending lowercase extension without copying
		
		close current document saving yes
		close front document saving no
	end tell
	
end repeat

on getBaseName(fName)
	set baseName to fName
	return baseName
end getBaseName

Model: I Book
AppleScript: 2.1.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

{Edited to correct AppleScript tags. The script goes between them}

twebl, I have cleaned up a few bits to your script. Not sure what “1-ea” is a folder? See if this helps any. Because your script calls a do action I have no idea of the content of your action you will need to check this in Photoshop as the Action could have a recorded save step which will be played out. You do only have 2 conditions in this script which can both be done in actions and batch process in CS1 you would need to check in v7 go to (menubar/file/automate) do you have “conditional mode change” as option? Here is the code give it a try and let us know how you get on?

set inputFolder to choose folder with prompt "Where is the input folder?"
set outputFolder to (path to desktop from user domain) & "ebl finals:" as string
--
tell application "Finder"
	set filesList to files in inputFolder
end tell
--
tell application "Adobe Photoshop 7.0"
	set display dialogs to never
end tell
--
repeat with aFile in filesList
	tell application "Finder"
		set theFile to aFile as alias
		set theFileName to name of theFile
	end tell
	--
	tell application "Adobe Photoshop 7.0"
		open theFile
		set docRef to the current document
		if (mode of docRef is not RGB) then
			change mode docRef to RGB
		end if
		if (bits per channel of docRef is sixteen) then
			set bits per channel of docRef to eight
		end if
		
		-- do action "D Package" from "test scripts"
		
		set docName to name of docRef
		set docBaseName to getBaseName(docName) of me
		set newFileName to (outputFolder as string) & docBaseName
		save docRef in file newFileName as TIFF with options ¬
			{class:TIFF save options, image compression:none, byte order:Mac OS, save alpha channels:true, save spot colors:true, embed color profile:true} appending lowercase extension with copying
		close docRef saving no
	end tell
end repeat
--
on getBaseName(fName)
	set baseName to fName
	repeat with idx from 1 to (length of fName)
		if (item idx of fName = ".") then
			set baseName to (items 1 thru (idx - 1) of fName) as string
			exit repeat
		end if
	end repeat
	return baseName
end getBaseName