--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/7359f5b8-8d20-48dd-95c8-f39599aae8d1%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/b06652fb-b8b7-497f-924c-8767c4596527%40googlegroups.com.
on exportTheRest
global gProjectToExport
put the long id of cd fld 1 into theField
push cd
lock messages
put "Writing scripts, please wait…" into cd fld 1
try
open inv wd 1 of proj gProjectToExport
catch tError
switch tError
case 53
alert "First project window contains no cards!" explain "Exporting won't work unless there's at least one..."
pop cd
put "Export failed!" into cd fld 1
unlock messages
exit script
end switch
end try
repeat with w = 1 to the num of windows
get exportScript(the long id of wd w)
repeat with b = 1 to the num of backgrounds of wd w
get exportScript(the long id of bg b of wd w)
repeat with p = 1 to the num of parts of bg b of wd w
get exportScript(the long id of part p of bg b of wd w)
end repeat
repeat with c = 1 to the num of cards of bg b of wd w
get exportScript(the long id of card c of bg b of wd w)
repeat with cp = 1 to the num of parts of cd c of bg b of wd w
get exportScript(the long id of part cp of cd c of bg b of wd w)
end repeat
end repeat
end repeat
end repeat
repeat with m = 1 to the num of menus
get exportScript(the long id of menu m)
repeat with i = 1 to the num of items of menu m
get exportScript(the long id of item i of menu m)
end repeat
end repeat
close proj gProjectToExport
pop cd
put "Export complete" into cd fld 1
unlock messages
end exportTheRest
on exportTheRest
global gProjectToExport
push cd
lock messages
put "Writing scripts, please wait…" into cd fld 1
try
open inv wd 1 of proj gProjectToExport
catch tError
switch tError
case 53
alert "First project window contains no cards!" explain "Exporting won't work unless there's at least one..."
pop cd
unlock messages
exit script
end switch
end try
repeat with w = 1 to the num of windows
get the script of wd w
if it ≠ empty then exportScript the long id of wd w, @it
repeat with b = 1 to the num of backgrounds of wd w
get the script of bg b of wd w
if it ≠ empty then exportScript the long id of bg b of wd w, @it
repeat with p = 1 to the num of parts of bg b of wd w
get the script of part p of bg b of wd w
if it ≠ empty then exportScript the long id of part p of bg b of wd w, @it
end repeat
repeat with c = 1 to the num of cards of bg b of wd w
get the script of card c of bg b of wd w
if it ≠ empty then exportScript the long id of card c of bg b of wd w, @it
repeat with cp = 1 to the num of parts of cd c of bg b of wd w
get the script of part cp of cd c of bg b of wd w
if it ≠ empty then exportScript the long id of part cp of cd c of bg b of wd w, @it
end repeat
end repeat
end repeat
end repeat
repeat with m = 1 to the num of menus
get the script of menu m
if it ≠ empty then exportScript the long id of menu m, @it
repeat with i = 1 to the num of items of menu m
get the script of item i of menu m
if it ≠ empty then exportScript the long id of item i of menu m, @it
end repeat
end repeat
close proj gProjectToExport
pop cd
put empty
put "Export complete" into cd fld 1
unlock messages
end exportTheRest
on exportScript tLID, theScript
global gSavePath, gProjectToExport
put gSavePath & replace(tLID, space & quote & gProjectToExport & quote, empty) & ".txt" into tFile
open file tfile
write theScript to file tfile
close file tfile
end exportScript
on mouseUp
global gSavePath, gProjectToExport
answer file "Select the Project to export scripts from:" with extension "sc45"
if it is empty then exit mouseup
put it into gProjectToExport
answer folder "Select a folder for the exported scripts (text files)"
if it is empty then exit mouseup
put it into gSavePath
exportProjectScript
exportTheRest
end mouseUp
If we were talking the difference between a tenth and three quarters of a second I wouldn't care, but even on an SSD for the SC Help project here these little optimizations mean the difference 1.75 and 14.25 seconds just for the export step alone.
on exportScript tLID, theScript
global gSavePath, gProjectToExport
put gSavePath & replace(tLID, space & quote & gProjectToExport & quote, empty) & ".txt" into tFile
open file tfile
write theScript to file tfile
close file tfile
end exportScript
You sure you didn't paste over the handler name. If any doubt just download the project again. It works just fine, just slower than Mark's handler.
--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/50aab242-b7a4-45ea-a7b2-aee1b0f92cbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BTW, BBEdit has a multi file search and replace function so it should be easy to swap out those variable names.
--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/428bc2a0-1a4b-4c1e-993b-73a7f460b05a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/df936537-271d-4ae3-ac09-b2b2ff33cbca%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/ee7e978c-18f8-42eb-883b-77b3dd0ba34f%40googlegroups.com.
So it works, but having multiple handlers with the same name in different locations doesn't sound like a good idea to me.
--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/CSQNNQP57Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/ee186277-4c1b-4e6d-9e3d-2012603a94ef%40googlegroups.com.
And I see how this could be useful for a Jedi scripter (I'm looking at you)