Copy or move subfolder content "pictures" to File Maker "Photo Catalog

My name’s François, needs help with script
the script within wont copy or move the pictures of subfolder to “Catalogue photo,fp7”
I’ve tried differeent options without succes, is it possible to have some help with the following sript

–Getiphotoimage - with two loops
set UserName to “UserName”
set FolderName to “iPhoto”
set xImage to “”

– Opens required apps.
tell application “Finder” to open file “Catalogue photo.fp7_JP-1”

– Opening principal directory
tell application “Finder”
activate
open folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– Obtaining numbers of folders (sub folders) of principal repertory
set DirCount to count folders of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
set d to 1
end tell

– Principal loop - to obtain folders - SubFolderName = folders
repeat until d > DirCount
tell application “Finder”
activate
set SubFolderName to name of folder d of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– Opening subfolders
open folder SubFolderName of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– Obtaining number of documents
set DocCount to count files of folder SubFolderName of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
set i to 1
set DocName to name of first file of folder SubFolderName of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– delete extension name (.jpg)
set CharCount to count every character of DocName
set DocName to characters 1 thru {CharCount - 4} of DocName
set DocName to DocName as text
end tell

-- Secondary loop to extract data from document
repeat until i > DocCount
	tell application "Finder"
		activate
		set DocName to name of file i of folder SubFolderName of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk
	end tell
	tell application "Finder" to open file i of folder SubFolderName of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk
	--Obtaining data from folder iPhoto	
	set Folder to SubFolderName
	set ID_ to DocName
	
	-- tell application "QuickTime Player"
	tell application "Preview"
		activate
		-- set Image to xImage
		set Image to document
		
	end tell
	
	--set picture to gImage
	
	-- Activatng FileMaker Pro to pass parameters to reaserch & change data
	tell application "FileMaker Pro"
		activate
		set field "gID" of current record to ID_ -- replace "text"
		set field "gDossier" of current record to Dossier -- replace "text"
		set field "gImage" of current record to xImage -- replace "multimedia"
		
		-- Execute FileMaker script: "Recherche Image et colle Image"
		do script "Recherche Image et colle Image"
	end tell
	--Reactivate QuickTime Player & close front window
	tell application "QuickTime Player"
		activate
		close front window
	end tell
	
	-- 	change la couleur du document une fois le processus terminé --Changes document colour once done
	tell application "Finder" to set label index of file i of folder SubFolderName of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk to 4 -- bleu
	
	-- Pour activer le prochain document de la série --	Activate following document of series	
	set i to i + 1
	
	tell application "Finder"
		activate
	end tell
end repeat

-- 	change la couleur de la chemise une fois le processus terminé --Changes folder colour once process done	
tell application "Finder" to set label index of folder d of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk to 2 -- rouge
-- passe au prochain réprtoire
set d to d + 1
tell application "Finder"
	activate
	close front window
end tell

end repeat
Thanks in advance for your help

Model: Powerbook G4
AppleScript: 2.0 (v43.1)
Browser: Safari 312.6
Operating System: Mac OS X (10.3.9)

It’s me Francois
In the preceding post, the only thing i Haven’t ben able to have done is " To get the picture to the app “FileMaker”
I’ve tried copy to clipboard
Set var to clipboard without succes any other wayto get these subfolders picture to my “FileMaker script” and have it paste in the “cell image”
Thanks for your help, any ideas accepted. And plesae tell me where to insert instructions.

Bonjour François,

if I got it right, you want gather all files of a specified folder (including subfolders)
and put the picture and its name in a Filemaker database.

This script does this, it creates new records in the current database and copies the data into it.
Any “detour” using the clipboard or Preview or grabbing the files from Finder windows is not needed,
it’s also not necessary to make any application frontmost (with activate) to execute the script


set FolderName to ((path to desktop as Unicode text) & "iPhoto:") -- 
set FPfile to ((path to desktop as Unicode text) & "Catalogue photo.fp7_JP-1")

tell application "FileMaker Pro" to open file FPfile
tell application "Finder" to set theFiles to files of entire contents of folder FolderName
repeat with oneFile in theFiles
	set ID_ to text 1 thru -5 of name of (info for (oneFile as alias))
	tell application "FileMaker Pro"
		tell document 1
			set field "gID" of current record to ID_ -- replace "text"
			-- set field "gDossier" of current record to Dossier -- replace "text"
			set field "gImage" of current record to (oneFile as alias) -- replace "multimedia"
			set newRecord to create new record
			go to newRecord
			-- Execute FileMaker script: "Recherche Image et colle Image"
			-- do script "Recherche Image et colle Image"
		end tell
	end tell
	tell application "Finder" to set label index of contents of oneFile to 4 -- bleu
end repeat

Hi everyone
Thanks to Stefan K, I got the solution
Simplifief and operational, here it is

set FolderName to ((path to desktop as Unicode text) & “Photo Nov 9-07”) –
set FPfile to ((path to desktop as Unicode text) & “-Calander Girls-2007”)

tell application “FileMaker Pro” to open file FPfile
tell application “Finder” to set theFiles to files of entire contents of folder FolderName
repeat with oneFile in theFiles
set i to 1
set ID_ to text 1 thru -5 of name of (info for (oneFile as alias))
set {TID, text item delimiters} to {text item delimiters, “:”}
set dossier to text item -2 of (oneFile as Unicode text)
set text item delimiters to TID
tell application “FileMaker Pro”
tell document 1
set field “gID” of current record to ID_ – replace “text”
set field “gDossier” of current record to dossier – replace “text”
set field “gImage” of current record to (oneFile as alias) – replace “multimedia”
set i to i + 1
– Execute FileMaker script: “Recherche Image et colle Image”
do script “Recherche Image et colle Image”
end tell
end tell
tell application “Finder” to set label index of contents of oneFile to 4 – bleu
end repeat
Hope it can be of some help
Francois