Search Again:

Re: AppleScripts?

From: Farokh Irani
Date: Tuesday, January 28, 2003
Time: 4:12:53 am

>Farokh Irani wrote on 1/26/2003 7:25 PM
>
>>Is there a web site or a URL where there's a repository of
>>AppleScripts for QDNS Pro 3.5.x?
>>
>>I can't seem to find anything on the M&M web site...
>
>Look in the Utilities folder of the installed folder.

There are only a few there, and I was wondering if there were any others.

I was attempting to make a change to every A record. I needed to
replace just the first 3 octets of the IP address, and when I ran the
script under OS X, it screwed up the zones. It appears that when I
attempt to set the IP address of the record, it seems to set the next
record, and I'm not sure why. Here's the script in question, with the
actual names changed. Any pointers would be appreciated. I've run
this script under both OS 9 and OS X with the same results.

property gTimeout : 900 -- timeout for opening large zones on slow
servers (default = 15 minutes)

tell application "QuickDNS Manager"
-- activate
set allZones to name of every zone whose type is master and enabled is true
repeat with theZone in allZones
if (theZone contains "a name") then -- test on one zone only
with timeout of gTimeout seconds
set theDoc to open zone (theZone as string)
end timeout
set changed to false
tell theDoc
set totalARecords to the count of every A record
repeat with i from 1 to totalARecords
set theRecord to (a reference to A record i)
if the IP address of theRecord begins with "ip1.ip2.ip3." then
set temp to the IP address of theRecord
set foo to (the length of temp)
set the IP address of theRecord to
"newip1.newip2.newip3." & (text 13 thru foo of temp)
set changed to true
end if
end repeat
if changed is false then --no change, then close the file,
leave changed ones open.
try
close saving no --yes don't save it
end try
end if
end tell
end if
end repeat
end tell

--

Farokh
----------------------------------------------------------------------------
MCF Software...simply dependably engineered
Developers of ListSTAR (http://www.liststar.com/), MacRADIUS
(http://www.macradius.com/), Address List Sorter
(http://www.mcfsoftware.com/als/), SimpleText Filter for EIMS
(http://www.mcfsoftware.com/stf/) and Auto Reply plug-in for EIMS
(http://www.mcfsoftware.com/vac/).



Messages In This Thread:



Return to Digital Point Solutions' Home Page