I’m getting the same behavior in Snow Leopard. If you want to try it for yourself, here are the steps:
1- execute the following script to create a similar database as mine (2 records only):
tell application “Database Events”
set quit delay to 0
make new database with properties {name:“my test database”}
save result
–next line replace “yourusername” by your own username
database “/Users/yourusername/Documents/Databases/my test database.dbev”
end tell
set La_liberte to {nom:“La Liberté”, ville:“”, type:“colonnes et lignes”, province:“MB”, contact:“production@la-liberte.mb.ca”, langue:“F”, nombre_de_colonnes:5, nombre_de_lignes:215, liste_des_colonnes:{2, 4.06, 6.13, 8.19, 10.25}, type_de_fichier:“PDF”, protocole_envoi:“email”, info_ftp:{}, representant:“”}
set The_Gazette to {nom:“The Gazette”, ville:“”, type:“colonnes et lignes”, province:“QC”, contact:“”, langue:“E”, nombre_de_colonnes:10, nombre_de_lignes:292, liste_des_colonnes:{0.9375, 2, 3.0625, 4.125, 5.1875, 6.25, 7.3125, 8.375, “NA”, 10.5}, type_de_fichier:“PDF”, protocole_envoi:“ftp”, info_ftp:{“ftp.gazette.com”, “thegazette”, “gaz”, “thegazette”}, representant:“The Corporation”}
set my_publications to {La_liberte, The_Gazette}
set z to 1
set my_publications_count to count every item in my_publications
repeat my_publications_count times
set this_publication to item z of my_publications
set my_name to nom of this_publication
set my_type to type of this_publication
set my_prov to province of this_publication
set my_lang to langue of this_publication
set my_contact to contact of this_publication
set my_rep to representant of this_publication
set my_nb_col to nombre_de_colonnes of this_publication
set my_nb_lignes to nombre_de_lignes of this_publication
set my_inter_column_list to liste_des_colonnes of this_publication
set this_count to count every item in my_inter_column_list
set my_column_list_string to “”
set counter to 1
set virgule to “,”
repeat this_count times
if counter = this_count then set virgule to “”
set my_column_list_string to my_column_list_string & (item counter of my_inter_column_list) & virgule as string
set counter to counter + 1
end repeat
set my_column_list to my_column_list_string
set my_inter_ftp_list to info_ftp of this_publication
set this_count2 to count every item in my_inter_ftp_list
set my_ftp_list_string to “”
set counter2 to 1
set virgule to “,”
repeat this_count2 times
if counter2 = this_count2 then set virgule to “”
set my_ftp_list_string to my_ftp_list_string & (item counter2 of my_inter_ftp_list) & virgule as string
set counter2 to counter2 + 1
end repeat
set my_ftp_list to my_ftp_list_string
set my_type_fichier to type_de_fichier of this_publication
set my_protocole to protocole_envoi of this_publication
set my_string to “tell application "Database Events"” & return & “tell database "my test database"” & return & “make new record with properties {name:"” & my_name & quote & “}” & return & “tell record” & space & quote & my_name & quote & return & “make new field with properties {name:"type de format", value:” & quote & my_type & quote & “}” & return & “make new field with properties {name:"province", value:” & quote & my_prov & quote & “}” & return & “make new field with properties {name:"contact", value:” & quote & my_contact & quote & “}” & return & “make new field with properties {name:"langue", value:” & quote & my_lang & quote & “}” & return & “make new field with properties {name:"nombre de colonnes", value:” & quote & my_nb_col & quote & “}” & return & “make new field with properties {name:"nombre de lignes", value:” & quote & my_nb_lignes & quote & “}” & return & “make new field with properties {name:"liste des colonnes", value:” & quote & my_column_list & quote & “}” & return & “make new field with properties {name:"type de fichier", value:” & quote & my_type_fichier & quote & “}” & return & “make new field with properties {name:"protocole d’envoi", value:” & quote & my_protocole & quote & “}” & return & “make new field with properties {name:"info ftp", value:” & quote & my_ftp_list & quote & “}” & return & “make new field with properties {name:"representant", value:” & quote & my_rep & quote & “}” & return & “end tell” & return & “save” & return & “end tell” & return & “end tell”
set the clipboard to my_string
tell application “AppleScript Editor”
make new document with properties {contents:my_string, name:“Inter”}
tell document “Inter”
compile
–delay 1
execute
–delay 1
close without saving
end tell
end tell
set z to z + 1
end repeat
-Step 2: execute the following script to set the comment of any file on your computer
tell application “Finder”
activate
set f to (choose file)
set comment of f to “La Liberté”
–if you set comment to “The Gazette” the next script won’t throw any error
end tell
-Step 3 execute the following script and choose the file you just “tagged”
tell application “Finder”
activate
set this_item to (choose file)
set my_container to (get container of this_item) as string
set my_email_folder to my_container & “envoyer par email”
set my_web_folder to my_container & “envoyer par browser Firefox”
set upload_result to “”
set file_name to get name of this_item
set publication_name to paragraph 1 of (get comment of this_item)
–if publication_name is “La Liberté” then set publication_name to “La Liberté”
end tell
–gather database record fields results
tell application “Database Events”
set quit delay to 0
database “/Users/yourusername/Documents/Databases/my test database.dbev”
tell database “my test database”
set liste_des_field to get value of every field of record publication_name
set my_name to item 1 of liste_des_field
set my_format to item 2 of liste_des_field
set my_province to item 3 of liste_des_field
set email_contact to item 4 of liste_des_field
set my_langue to item 5 of liste_des_field
set my_nbcol to item 6 of liste_des_field
set my_nblignes to item 7 of liste_des_field
set my_col_list to item 8 of liste_des_field
set my_fichier to item 9 of liste_des_field
set my_protocole to item 10 of liste_des_field
set liste_ftp_avant to item 11 of liste_des_field
set my_rep to item 12 of liste_des_field
end tell
end tell
You should get an error if you tagged the file with “La Liberté” on step 2 but not if you tagged the file with “The Gazette”. That’s the behavior I’m getting here (Leopard, Snow Leopard). But everything was fine in Tiger…
Browser: Firefox 3.0.6
Operating System: Mac OS X (10.6)