Import picture into filemaker

I have created a script to import a picture into a filemaker database. What I am not sure is does this embed the image or store only a reference? My hunch ( by checking the fiesize of this test database) is that it seems to imbed the image. I have also tried trashing the related image but its still there in the database. Is there a way to store a reference only


tell application "FileMaker Pro7"
	tell database "Client_Data"
		set imagepath to cell "path" of current record as string
		set imagepath to my getImage(imagepath)
		set cell "Picture" of current record to imagepath
	end tell
end tell

on getImage(imagepath)
	set imagepath to (imagepath & "Original Files:")
	set images to list folder imagepath without invisibles
	set image to item 1 of images
	set imagepath to (imagepath & image) as alias
	return imagepath
end getImage

It took me some time to figure it out. But this works for me. It believe it always uses reference. This does for sure.

Both Image:/ and Imagemac:/ work.

This solution is specific for me since I created the filename before from FM and then import the file in a container field. So changes are probably needed.


set pathname to (path to pictures folder) as text
set myResult to snr(pathname, ":", "/")

(**** fast search and replace methods ****)
on snr(the_string, search_string, replace_string)
	return my list_to_string((my string_to_list(the_string, search_string)), replace_string)
end snr

on list_to_string(the_list, the_delim)
	my atid(the_delim)
	set the_string to the_list as string
	my atid("")
	return the_string
end list_to_string

on string_to_list(the_string, the_delim)
	my atid(the_delim)
	set the_list to (every text item of the_string) as list
	my atid("")
	return the_list
end string_to_list

on atid(the_delim)
	set AppleScript's text item delimiters to the_delim
end atid

tell application "FileMaker Pro Advanced"
	tell database "Inschrijver"
		tell table "Setup"
			set cellValue of cell "FM CONTAINER FIELDNAME" to ("image:/" & myResult & PATHTOYOURFILE & ".jpg")
		end tell
	end tell
end tell