Re: help with a script
Re: help with a script
- Subject: Re: help with a script
- From: email@hidden
- Date: Wed, 22 Nov 2000 20:14:12 EST
--the following script keeps a file record of the numbers. it works. to
change a series open the file in the prefs folder and change the number. Hope
this helps.
tell application "Finder"
if not (exists alias ((path to preferences folder as text) & "Incrementor
file")) then
set thefile to (make file at preferences folder with properties {name
:"Incrementor file"}) as alias
display dialog "What shall the first number be?" default answer "205"
buttons "OK" default button 1
set startnum to the text returned of the result as number
open for access thefile with write permission
write (startnum as text) to thefile
close access thefile
set thenum to startnum
else
set thefile to alias ((path to preferences folder as text) & "
Incrementor file") as alias
close access thefile
open for access thefile with write permission
set thenum to (read file thefile) as number
close access thefile
end if
display dialog (thenum as text)
set newnum to thenum + 1
open for access thefile with write permission
set eof of thefile to 0
write (newnum as text) to thefile
close access thefile
end tell