--STYLES IN A LINE --================ --This script is associated with several styles which will --be created in the PageMaker document with names such as --Style1, Style2 etc. --The first time it is run it will create styles of these --names if they do not exist, sufficient for the number of --tabs in the first line of the selected area. It will --then ask you to define these and run the script again. --The base style already applied will continue to apply --from the lefthand side of the column to the first tab. --Style1 will apply from the first tab, Style2 from the --second tab, and so on. --The script picks up font,size, leading, case and if bold or --italic are invoked in these styles. Other aspects, such as --underline, sub/superscript, color etc. are not applied, --but could be added quite easily. --There should be a return at the end of each selected line. GetTextCursor >> storyID, begin0, end0 SetTextCursor storyID,begin0,end0 GetTabs >> tabcount,... if tabcount = 0 Message "No user-defined tabs specified" return endif GetStyleNames >> stylelist GetStyle >> basestyle stylemissing = 0 missinglist = "" Loop a = 1, tabcount stylename = "Style" + ""(a) If stylename # stylelist = 0 stylemissing = 1 StyleBegin stylename BasedOn basestyle StyleEnd if missinglist = "" missinglist = stylename else missinglist = missinglist + ", " + stylename Message missinglist endif endif endloop leavit = 0 if stylemissing = 1 Message "There was at least one style not defined," Message "Please define the following:" Message missinglist leavit = 1 endif if leavit = 1 Return endif Loop a = 1, tabcount StyleBegin "Style" + ""(a) GetCase >> tc tcase[a] = tc GetFont >> fname fontname[a] = fname GetLeading >> lding leading[a] = lding GetSize >> size[a] GetTypeStyle >> mask, applied if applied > 3 typeitalic[a] = 1 else typeitalic[a] = 0 endif if applied > 1 typebold[a] = 1 else typebold[a] = 0 endif StyleEnd endloop secfinish = 0 Deselect SetTextCursor storyID, begin0, begin0 while secfinish < end0 TextSelect +eol GetTextCursor >> storyID, start, finish SetTextCursor storyID,start,start EditStory Loop a = 1, tabcount Find "^t" GetTextCursor >> ...,tabpos[a],... endloop tabpos[0] = start Loop a = 1, tabcount secstart = tabpos[a] b = a c=a+1 if a = tabcount secfinish = finish else secfinish = tabpos[c] endif SetTextCursor storyID,secstart,secfinish --Message ""(tcase[a]) tc = tcase[b] fname = fontname[b] lead = leading[b] sizer = size[b] Case tc Font fname Leading lead Size sizer TypeStyle 0 if typebold[a] = 1 TypeStyle bold endif if typeitalic[a] = 1 TypeStyle italic endif endloop CloseStory place SetTextCursor storyID,secfinish,secfinish TextCursor +char secfinish = secfinish+2 endwhile return