I have a script made of multiple records (kind of a database script) which returns the records on run. I’m loading that script into my main script and everything works fine when running my main script from Script Editor. But as soon as I save my main script as run-only applet, it will run as expected except for that error message it throws me at the end “Could not save changes to this script because of a scripting system (OSA) error. -2707” I’m new to the load script concept. Also if someone could suggest me a better sorting algorythm (maybe shell script based) the one I’m using is pretty slow for my 400+ records that will eventually exceed 1000. Thank you guys. Here’s my main script code:
set script_path to ((path to desktop as string) & “Script compilés 4 mars 2009:base de donnee journaux.scpt”)
set my_script_variablelibrary to load script file script_path
tell my_script_variablelibrary to run
set nom_journaux to {}
repeat with this_item in all_journaux
set nom_journaux to nom_journaux & (get nom of this_item)
end repeat
–sorting routine
set the index_list to {}
set the sorted_list to {}
set jobcount to count every item in nom_journaux
repeat jobcount times
set the low_item to “”
repeat with i from 1 to jobcount
if i is not in the index_list then
set this_item to item i of nom_journaux as text
if the low_item is “” then
set the low_item to this_item
set the low_item_index to i
else if this_item comes before the low_item then
set the low_item to this_item
set the low_item_index to i
end if
end if
end repeat
set the end of sorted_list to the low_item
set the end of the index_list to the low_item_index
end repeat
set nom_journaux to sorted_list
–end of sorting routine
set journal_choisi to (choose from list nom_journaux) as string
repeat with this_item in all_journaux
if this_item contains {nom:journal_choisi} then set this_paper to this_item
end repeat
set province to province of this_paper
set langue to langue of this_paper
set contact to contact of this_paper
set nombre_de_colonnes to nombre_de_colonnes of this_paper
set nombre_de_lignes to nombre_de_lignes of this_paper
set liste_des_colonnes to liste_des_colonnes of this_paper
set representant to representant of this_paper
set dialogue_information to "Journal choisi: " & journal_choisi & return & "Province: " & province & return & "Contact: " & contact & return & "Langue: " & langue & return & "Représentant: " & representant & return & "Nombre de colonnes maximum: " & nombre_de_colonnes & return & "Nombre de lignes maximum: " & nombre_de_lignes
display dialog "Date de mise à jour: " & date_modif & return & return & dialogue_information & return & return & "Nombre de journaux dans la liste: " & i