CompuServe Thread

Script Macros

6 messages in this thread
#30752From: Art SteinmetzNov 26, 1991 10:50 AM
I've taken a few whacks at macros for your script and I've made some progress. I managed to create a "De-Scenify" script that strips the scene numbers and restores the margins on the scene title lines to the same margins as the body text. I've also got a script that does a fair job of picking out scene titles. The details, of course, are the killers. Technical problems arise from ID'ing scene titles by their traits. They have two: They're all caps and they start at the left indent. Flagging a section of text as all caps is easy enough. Unfortunately Prowrite lacks any facitlity for determining the position of insert point nor do any positioning commands guarantee the insert point will be at the beginning of the line. Also 'Move to end of paragraph' or '..line' would be useful to mark the whole title since 'Move to end of sentence' considers dashes ("-") to be a sentence end. Computers oughta work to accomodate us, not the other way 'round but ProWrite's ARexx set isn't quite robust enough yet (or I'm not clever enough 🙂 ). So…how do you feel about putting some "flag" character at the beginning of your scene titles? Say, a tilde ("~") or any character you think you won't otherwise use. This will give us another trait to ID scene titles. Alternatively you could guarantee no other phrase that qualifies as a complete Prowrite sentence will be in all caps. This affects things like "FADE OUT" and "CUT TO." Or we can create an exceptions table containing a vocabulary of directions so things like "FADE OUT" will be excepted. Now we're getting complicated, though. What do you think? — Art
#30764From: J.R. BOOKWALTERNov 26, 1991 1:09 PM
Art: I sat down Sunday with ProWrite 3.2.1 and the book "Using Arexx on the Amiga" and came up with a fairly workable Arexx script that formats by looking for the "*" character. Everywhere it finds one it un-indents, types a sequential number, tabs in one stop, moves the cursor down then left (to bring it at the end of the previous line), tabs in, stamps the same number as before then continues until it runs out of "*"'s. It formatted a 90-page script in 17 minutes, a vast improvement over the 3-4 hours it takes by hand. The problem is the first line of the screenplay must be set manually, then the Arexx script will copy that to each sequential lead line. I have a second script which does the whole thing (adding to it dropping unnecessary tab stops in the lead lines) but takes MUCH longer (over twice as long). Also, this script fails to accomodate any page breaks where CONTINUED would need to be numbered same as the shot preceding it. Anyway, here it is: Options results RequestText 'Number to start with?' /* Request shot number to start with */ If rc ~= -0 Then Exit number = result + 1 Do Forever /* Repeat forever */ Find "*" /* Search for lead line marker */ If rc ~= 0 Then Exit /* If lead line is not found, exit */ Type number /* Type first shot number */ ApplyFormat ASCII 9 /* Tab in one stop to fix lead line */ CursorDown CursorLeft ASCII 9 Type number newNumber = number + 1 If number < newNumber Then number = newNumber end Comments? I think searching for the "*" character is fine. It's a character that would not be normally used in a screenplay anyway. J.R.
#30765From: J.R. BOOKWALTERNov 26, 1991 1:11 PM
OOPS! That macro got munged. Here it is again: Options results RequestText 'Number to start with?' /* Request shot number to start with */ If rc ~= -0 Then Exit number = result + 1 Do Forever /* Repeat forever */ Find "*" /* Search for lead line marker */ If rc ~= 0 Then Exit /* If lead line is not found, exit */ Type number /* Type first shot number */ ApplyFormat ASCII 9 /* Tab in one stop to fix lead line */ CursorDown CursorLeft ASCII 9 Type number newNumber = number + 1 If number < newNumber Then number = newNumber end
#30946From: Art SteinmetzNov 30, 1991 3:36 PM
* Now you're gettin' it! The script works great. Now we can just tack features on around that base to address problems and make it as general as possible. Here's two refinements. Regarding your need to manually set the first lead ruler. The modifications below will apply arbitrary ruler settings to the current paragraph. The script you sent me didn't have pagebreak 'CONTINUED's but I've added a feature I think deals with it. The requires you to use PW's EXTRACT command to examine the line in some detail. This could slow you down. Note the use of Arexx labels to create subroutines. This makes the script easier to follow. — Art */ Options results ADDRESS 'ProWrite' * not necessary but let's you start this from CLI for tests */ * Lead Head margin and indent settings (decipoints) */ LeadRuler = "1080, 810, 180, TabRight, 5580" RequestText 'Number to start with?' /* Request shot number to start with */ If rc ~= -0 Then Exit number = result + 1 Find "*" /* Search for the first lead line marker */ If rc ~= 0 Then Exit /* If lead line is not found, exit */ CALL MakeRuler(LeadRuler) /* see procedure below */ RetainFormat /* remember what we've created */ CursorUp /* back up some */ DO Forever Find "*" /* Search for lead line marker */ If rc ~= 0 Then Exit /* If lead line is not found, exit */ IF (pos('CONTINUE',GetSentence()) > 0) THEN /* is a page break */ number = number -1 /* next two lines required cuz 'GetSentence' messes with selection */ CursorUp /* back up some */ Find "*" /* find same symbol again */ Type number /* Type first shot number */ ApplyFormat ASCII 9 /* Tab in one stop to fix lead line */ CursorDown CursorLeft ASCII 9 Type number newNumber = number + 1 If number < newNumber Then number = newNumber END [ MORE ]
#30947From: Art SteinmetzNov 30, 1991 3:36 PM
[ continuation ] EXIT * ====================================================== */ * this procedure will apply a margins, indent and one tab stop */ * would work better if we could remove exisiting tab stops */ * but PW won't tell us where they are */ MakeRuler: PROCEDURE arg Ruler PARSE VAR Ruler LM "," LI "," RM "," TabType "," TabPos . LeftMargin LM LeftIndent LI RightMargin RM TabType AddTab TabPos RETURN * ====================================================== */ GetSentence: PROCEDURE * Flawed because PW flags ' – ' as sentence end. */ AltDown CursorLeft CtrlDown CursorRight CtrlUp AltUp Extract IF result = 'RESULT' THEN Sentence = '' ELSE Sentence = result CursorRight /* turn off select */ RETURN Sentence * ====================================================== */ — Art via Amiga Whap!
#30950From: J.R. BOOKWALTERNov 30, 1991 3:46 PM
Art, Didn't get to read most of your message as it flew by, but I've captured it and will log back on after I try the new script out. Thanks! J.R.