Hello Joseph!
Thanks for your help. Now my script works as I expect.
Without your help I wouldn’t figure out the “()” missing…
This simple script shows me how it is done:
set dateStamp to getDateStamp()
on getDateStamp()
set today to current date
set m to my getMonthNum(today)
if m < 10 then set m to “0” & m as text
return m as text
end getDateStamp
on getMonthNum(inDate)
set monthNameList to {“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”}
repeat with i from 1 to count of monthNameList
if month of inDate as text = item i of monthNameList then return i
end repeat
end getMonthNum
display dialog dateStamp
My whole script that I call from within file maker is so:
set the iDay to day of the (current date) as integer
on getDateStamp()
set today to current date
set m to my getMonthNum(today)
if m < 10 then set m to “0” & m as text
return m as text
end getDateStamp
on getMonthNum(inDate)
set monthNameList to {“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”}
repeat with i from 1 to count of monthNameList
if month of inDate as text = item i of monthNameList then return i
end repeat
end getMonthNum
tell application “Tex-Edit Plus”
activate
select insertion point before contents of window 1
paste
replace window 1 looking for “^t” replacing with “”
replace window 1 looking for “,” replacing with “”
replace window 1 looking for “.” replacing with “”
replace window 1 looking for “-” replacing with “”
replace window 1 looking for “/” replacing with “”
replace window 1 looking for “Á” replacing with “A”
replace window 1 looking for “É” replacing with “E”
replace window 1 looking for “Í” replacing with “I”
replace window 1 looking for “Ó” replacing with “O”
replace window 1 looking for “Ç” replacing with “C”
replace window 1 looking for “Õ” replacing with “O”
replace window 1 looking for “Ô replacing with “A”
replace window 1 looking for “Ê” replacing with “E”
replace window 1 looking for “Ô” replacing with “O”
replace window 1 looking for “” replacing with “A”
save window 1 in file ((path to desktop as string) & “SCE” & ((iDay) as text) & my getDateStamp() & “A.seq”) as string with creator «class TBB6»
quit
end tell
say “Arkeevoh salvoh noh desktop!” using “Trinoids” –
display dialog “Seu Arquivo de remessa foi salvo na area de trabalho!” buttons {“OK”} default button 1 giving up after 10
Would you indicate me an Applescript book for a starter as me?