Greetings
String confused with Items?? what am I doing wrong?
It is supposed to return in the log file something like…
<the date & time> “** * * * * * * * * * * * * * * * * * **”
To run the script, I think you need a folder called “backup” on the desktop.
-- THE START
my logit(decorate("*", 0), "")
--Define log
to logit(log_string, log_file)
--Write to log file
if log_file is "" then
set log_file to "Backup History"
end if
do shell script ¬
"echo `date '+%Y-%m-%d %T: '`\"" & log_string & ¬
"\" >> " & (quoted form of POSIX path of (path to desktop)) & "backup/" & quoted form of log_file & ".log"
end logit
to decorate(c1, x)
if x is 0 then set x to 9
set mystring to ""
repeat with i from 1 to x
set mystring to (mystring & c1 as string)
set c1 to (c1 & space as string)
end repeat
repeat with i from 1 to x
set mystring to (mystring & c1 as string)
set c1 to (characters 1 thru -2 of c1 as string) -- *** I guess this is the offensive line ***
end repeat
set mystring to (mystring & c1 as string)
set mystring to (mystring & c1 as string)
return mystring
end decorate
…what I get is the first half of the string then a great mass of commas and occasional spaces and asterisks…
It seems like variable c1 turns into a list at some point…???
This is part of a backup script I wrote recently after three days of research on this forum. : )
Any help or advice would be appreciated.
Kind regards, nodrog.
Model: Mac mini
AppleScript: no idea
Browser: Safari 533.22.3
Operating System: Mac OS X (10.5)