Journler and htm

Hi,
sombody here knows how to import alias files as resources (a folder in my case) to attach at a htm/l-file ?

--DropBox
--journler
(*
tell application "Finder" to set xx to the selection as alias list
tell application "Journler" to drop box xx
*)

tell application "Finder"
	set xx to the selection as alias list
	--process documents to import
	set nm_of to {}
	set pt_of to {}
	repeat with i in xx
		if class of i is not folder then
			if kind of i = "HTML" then
				copy name of i to end of nm_of
				set my_pt to parent of item i
				copy (my_pt as text) to end of pt_of
			end if
			tell application "Journler" to drop box i
		end if
	end repeat

	--add folders, if Html in the selection
repeat with i from 1 to count of items in nm_of
		set these_fl to item i of nm_of as text
		set right_pt to item i of pt_of as text
		set the_lg to (length of these_fl) / 2 as integer
		set find_nm to (characters 1 thru the_lg of these_fl)
		set find_nm to find_nm as text
		
		if exists (items in alias right_pt whose name begins with find_nm and class is folder) then
			set acc_fl to (folders in alias right_pt whose name begins with find_nm) as text
			set f to POSIX path of acc_fl
			tell application "Journler" to import f --in folder "Anhänge"
		end if
	end repeat

end tell


Here are a couple of examples. Not sure which is the right one for your script:

tell application "Finder"
	try
		set S to selection as alias list
	on error -- only one selection, as alias list fails.
		set S to selection as alias as list
	end try
	set N to {}
	repeat with I in S
		set end of N to name of I
	end repeat
end tell

tell application "Journler"
	repeat with k from 1 to count S
		set NE to make new entry with properties {name:item k of N}
		make new resource at NE with properties {aliased:true, original path:(POSIX path of item k of S), name:item k of N}
	end repeat
end tell

or

tell application "Journler"
	set tEntry to make new entry with properties {name:"Alias Import", rich text:("This entry is to hold an alias to an Application." & return & return), comments:"Alias"}
	set tFile to choose file
	set N to name of (info for tFile)
	set tPath to POSIX path of tFile
	make new resource with properties {owner:tEntry, type:media, aliased:true, name:N, original path:tPath}
	save changes
end tell

fine. Thanks, adam. Umm…i’ve to think simpler. Not simple, at all.