home *** CD-ROM | disk | FTP | other *** search
- on GetWideCaptions start
- global tmplist
- set tmplist to []
- set flist to "Filenames"
- set num to the number of lines in field flist
- put "Getting maker numbers..."
- repeat with i = 1 to num
- set tmp to line i of field flist
- if notEmpty(tmp) then
- set mnum to NameToNum(tmp)
- add(tmplist, mnum)
- end if
- end repeat
- set flist to "Filenames2"
- set num to the number of lines in field flist
- repeat with i = 1 to num
- set tmp to line i of field flist
- if notEmpty(tmp) then
- set mnum to NameToNum(tmp)
- add(tmplist, mnum)
- end if
- end repeat
- put tmplist
- set tmpcaptions to EMPTY
- set gArticles to []
- set num to count(tmplist)
- repeat with i = start to num
- set curart to getAt(tmplist, i)
- set tt to line 2 of field (curart && "script")
- do(tt)
- put tt
- put gArticles
- set widecap to the text of field (curart & ".cap-wide")
- set cap to the text of field (curart & ".cap")
- set the itemDelimiter to "@"
- set numchap to count(gArticles)
- set the itemDelimiter to ","
- repeat with j = 1 to numchap
- set the itemDelimiter to "@"
- set chap to item j of cap
- set widechap to item j of widecap
- set the itemDelimiter to "#"
- set numart to count(getAt(gArticles, j))
- set the itemDelimiter to ","
- set tmpchapter to EMPTY
- repeat with k = 1 to numart
- set the itemDelimiter to "#"
- set thinarticle to item k of chap
- set widearticle to item k of widechap
- set the itemDelimiter to ","
- set article to curart & "-" & j & "." & k
- set numarticle to the number of cast article
- put article && numarticle
- set type to getAt(getAt(gArticles, j), k)
- put "type = " && type
- if type contains "pic" then
- if numarticle > 0 then
- if the width of cast numarticle > the height of cast numarticle then
- put "wide!"
- set thinarticle to widearticle
- else
- put "thin!"
- end if
- end if
- else
- if type contains "movie" then
- set thinarticle to widearticle
- end if
- end if
- set the itemDelimiter to "#"
- put thinarticle into item k of tmpchapter
- set the itemDelimiter to ","
- end repeat
- set the itemDelimiter to "@"
- put tmpchapter into item j of tmpcaptions
- set the itemDelimiter to ","
- end repeat
- put tmpcaptions
- put tmpcaptions into field (curart & ".cap-fixed")
- end repeat
- end
-
- on widefixnames start, end
- repeat with i = start to end
- set tmpname to string(the name of cast i)
- put "0ld " && tmpname
- set the itemDelimiter to "."
- set n to item 1 of tmpname
- set the itemDelimiter to ","
- set tmpname to n & ".cap"
- set the name of cast i to tmpname
- put "new" && tmpname
- end repeat
- end
-