thought I was out of the woods
Posted: Sun Apr 19, 2009 11:46 pm
after all the trouble i had with saving and loading, now my app is broken when running from the stand alone. In my app the user creates imag map areas on a jpg image. He can then create other image map documents or description documents. from the links he creates. In the end he can export to html. The export script works perfect if runrev, but from the stand alone it does nothing. here is the code for the script:
I know thats a lot, and i don't expect anyone to debug that since it works in runrev. My question is, is there a problem with using the ask command like i did since that is the first part of the script and the ask dialog doesn't come up when run outside of runrev.
Code: Select all
on exportToHtml
global tMainArrayInc
global tPassDocNumber
global tMainArray
global tMapAreaParses
global tAdventureName
ask "Please name your adventure"
put it into tAdventureName
--Creates folders main html and mainmap description files
do "create folder " & quote & tAdventureName & quote
do "create folder " & quote & tAdventureName & "/docs" & quote
do "create folder " & quote & tAdventureName & "/docs/maps" & quote
put "<HTML>"& cr &"<HEAD> "& cr &"</HEAD> "& cr &"<FRAMESET rows=" & quote & ",66%,33%" & quote & "> "& cr &"<FRAMESET cols=" & quote & "66%,33%" & quote & ">"& cr &"<FRAME src =" & quote & "docs/mainmap.html" & quote & " name=" & quote & "map" & quote & ">"& cr &"<FRAME src =" & quote & "docs/mainmapnotes.html" & quote & " name=" & quote & "notes" & quote & ">"& cr &"</FRAMESET>"& cr &"<FRAME src = " & quote & "docs/mainmapdmnotes.html" & quote & " name=" & quote & "dmnotes" & quote & ">"& cr &"</FRAMESET>"& cr &"<BODY>"& cr &"</BODY>"& cr &"</HTML>" into tIndex
put tIndex into url ("file:" & tAdventureName & "/"& tAdventureName & ".html")
put "<HTML>"& cr &"<HEAD>"& cr &"</HEAD>"& cr &"<BODY background=" & quote & "bg.jpg"& quote &">" into tNotesHead
put "</BODY>"& cr &"</HTML>" into tNotesFoot
put tNotesHead & tMainArray[mainmapnotes] & tNotesFoot into url ("file:" & tAdventureName & "/docs/MainmapNotes.html")
put tNotesHead & tMainArray[mainmapdmnotes] & tNotesFoot into url ("file:" & tAdventureName & "/docs/MainmapDMNotes.html")
do "revCopyFile " & quote & "images\bg.jpg" & quote & ", " & quote & tAdventureName & "\docs\bg.jpg" & quote
--Creates Map Html Documents
repeat with x =1 to the value of tMainArrayInc
do "put tMainArray[" & x & "][tParentName] into tDocName"
do "put tMainArray[" & x & "][mapfile] into tMapLoc"
put "<HTML>"& cr &"<HEAD> "& cr &"</HEAD>"& cr &"<BODY background=" & quote &"bg.jpg" & quote &">"& cr &"<IMG SRC=" & quote & "maps\" & tDocName & ".jpg" & quote &" USEMAP=" & quote &"#" & tDocName & quote &" BORDER=" & quote &"0" & quote &">"& cr &"<MAP NAME=" & quote & tDocName & quote &">" into tHtmlHead
put "</MAP>" & cr & "<BODY>"& cr &"</BODY>"& cr &"</HTML>" into tHtmlFoot
do "revCopyFile " & quote & tMapLoc & quote & "," & quote & tAdventureName & "\docs\maps\" & tDocName &".jpg" & quote
put x into tPassDocNumber
parseMapAreas
parseNotes
--Combines all parts of map and writes it to html document
put tHtmlHead & tMapAreaParses & tHtmlFoot into url ("file:" & tAdventureName & "/docs/" & tDocName & ".html")
end repeat
end exportToHtml