On Nov 30, 2008, at 3:04 PM, Scott Haneda wrote:
Can anyone help me get started.
set theString to "abc" & tab & "defgh" & tab & "123456" & tab & "QT"
set text item delimiters to tab
set wordList to text items of theString
set text item delimiters to ""
set x to 0
repeat with thisItem in the wordList
if length of contents of thisItem is greater than x then set x to length of contents of thisItem
end repeat
set filler to space
repeat 71 times
set filler to filler & space
end repeat
set NewWordList to {}
display dialog "Do you want the words to be left justified or right justified?" & return & ¬
"How many spaces between words?" default answer ¬
"" buttons {"Left justified", "Right Justified", "Cancel"} default button "Cancel"
set {justificate, spacing} to {button returned, text returned} of the result
repeat with thisWord in wordList
if justificate is "right justified" then
set the NewWordList to the NewWordList & text -(x + spacing) through -1 of (filler & thisWord)
else
set the NewWordList to the NewWordList & text 1 through (x + spacing) of (thisWord & filler)
end if
end repeat
NewWordList as text
--
The reason that so few people think outside the box is that all the pay and benefits are inside the box.