Using Shane’s book as a guide, I have converted 3 modal Open panels to 3 sheets. Everything works, but there is a glitch. Each Open panel’s “done” routine calls the next Open panel routine in order. I have it set up this way because each opened file is handled differently (if they were all handled the same, I’d make multiple selections available). The problem is before the first sheet “retracts” the second sheet is displayed. From the second sheet to the third (and final) sheet everything works as it should. A “phantom” disabled first sheet remains over the window after the third sheet “retracts.” None of its buttons are responsive and it won’t go away.
The code is below:
on openOffensiveStatsFile_(sender)
tell current application's NSOpenPanel to set thePanel to makeOpenAt_types_files_multiples_prompt_title_(path to desktop, {"txt"}, true, false, "Open OFFENSIVE STATS File", "")
tell thePanel to showOver_calling_(nflSpreadsWindow, "openOffensiveStatsFileDone:")
end openOffensiveStatsFile_
on openDefensiveStatsFile_(sender)
tell current application's NSOpenPanel to set thePanel to makeOpenAt_types_files_multiples_prompt_title_(path to desktop, {"txt"}, true, false, "Open DEFENSIVE STATS File", "")
tell thePanel to showOver_calling_(nflSpreadsWindow, "openDefseniveStatsFileDone:")
end openDefensiveStatsFile_
on openLeagueStatsFile_(sender)
tell current application's NSOpenPanel to set thePanel to makeOpenAt_types_files_multiples_prompt_title_(path to desktop, {"txt"}, true, false, "Open LEAGUE STATS File", "")
tell thePanel to showOver_calling_(nflSpreadsWindow, "openLeagueStatsFileDone:")
end openLeagueStatsFile_
on openOffensiveStatsFileDone_(theResult)
if theResult = missing value then
-- cancel button
log "Cancel pressed"
else
tell current application to set offStatsRaw to paragraphs of (read file (theResult as text))
getOffensiveStats(offStatsRaw)
openDefensiveStatsFile_(me)
end if
end openOffensiveStatsFileDone_
on openDefseniveStatsFileDone_(theResult)
if theResult = missing value then
-- cancel button
log "Cancel pressed"
else
tell current application to set defStatsRaw to paragraphs of (read file (theResult as text))
getDefensiveStats(defStatsRaw)
openLeagueStatsFile_(me)
end if
end openDefseniveStatsFileDone_
on openLeagueStatsFileDone_(theResult)
if theResult = missing value then
-- cancel button
log "Cancel pressed"
else
tell current application to set leagueStatsRaw to paragraphs of (read file (theResult as text))
getLeagueStats(leagueStatsRaw)
end if
end openLeagueStatsFileDone_
Is there a problem with my code or is this a glitch in either ASOC or the Myriad Helpers? The getOffensiveStats(), getDefensiveStats() and getLeagueStats() are handlers that have been working fine. I originally wrote the open handlers using modal dialogs.
btw, Shane, I’m not trying to imply that your Myriad Helpers are at fault. I appreciate the time and effort you have put into these to make our lives easier.
Thanks in advance,
Brad Bumgarner