As the subject says, my App is freezing as soon as I read a key in a .plist file, and then try to do something with the value, such as a Display Dialog.
on addOnAChosenPlaylist_()
set p to 1
try
tell playlistsThatAreChosenTable to deselectAll_(me)
tell PlaylistsToChoosefromArrayController
set allTheItems to selectedObjects()
tell playlistsToChooseFromTable to deselectAll_(me)
end tell
set TheItem to item 1 of allTheItems
set countOfPlaylist to TheItem's countOfPlaylistKey as text
set nameOfPlaylist to TheItem's nameOfPlaylistKey as text
set persistentPlaylistID to TheItem's persistentPlaylistIDKey as text
try
set playListsData to (PlaylistsThatAreChosenArrayController's arrangedObjects())
set p to 2
set aPredicate to current application's NSPredicate's predicateWithFormat_("persistentPlaylistIDKey beginswith[cd] persistentPlaylistID")
set p to 3
set theList to playListsData's filteredArrayUsingPredicate_(aPredicate)
set p to 4
if theList's |count|() = 0 then
set p to 6
PlaylistsThatAreChosenArrayController's addObject_({countOfPlaylistKeyTwo:countOfPlaylist, nameOfPlaylistKeyTwo:nameOfPlaylist, persistentPlaylistIDKeyTwo:persistentPlaylistID})
set my disableThePlayImmediatelyButton to false
set thetests to PlaylistsThatAreChosenArrayController's arrangedObjects()
set thetest to item 1 of thetests
display dialog thetest's countOfPlaylistKeyTwo as text # FREEZING HERE!
set p to 7
end if
set p to 8
on error errmsg number errnum
my thereHasBeenAnError("addOnAChosenPlaylist_ inner", errmsg, errnum, 0, p)
end try
set p to 9
PlaylistsThatAreChosenTwoArrayController's removeObjects_(PlaylistsThatAreChosenTwoArrayController's arrangedObjects())
set p to 10
PlaylistsThatAreChosenTwoArrayController's addObjects_(PlaylistsToChoosefromArrayController's arrangedObjects())
set p to 11
tell playlistsToChooseFromTable to deselectAll_(me)
set p to 12
tell playlistsThatAreChosenTable to deselectAll_(me)
set p to 13
my saveData()
set p to 14
my setTheChosenPlaylistMoveArrows()
set p to 15
my setUpPlaylistsToChooseFromList()
on error errmsg number errnum
my thereHasBeenAnError("addOnAChosenPlaylist_", errmsg, errnum, 0, 0)
end try
end addOnAChosenPlaylist_