Search Again:

Applescripting Load Balance records

From: JWBaumann@aol.com
Date: Friday, May 5, 2000
Time: 8:34:37 pm

I'm trying to Applescript the creation of load balance records with QuickDNS
Pro admin. When I record the creation of an empty load balance record, I get
this:

tell application "QuickDNS Pro Admin"
activate
set infotext of Load Balance record 1 of document 1 to "Hosts: 0"
set infotext of Load Balance record 1 of document 1 to "Hosts: 0"
set name of Load Balance record 1 of document 1 to "untitled.com."
set name of Load Balance record 1 of document 1 to "untitled.com."
set infotext of Load Balance record 1 of document 1 to "Hosts: 0"
set name of Load Balance record 1 of document 1 to "untitled.com."
end tell

However, when I attempt to play these commands back, I get errors such as
"Unknown object type" if there is not already a Load Balance record 1.

Worse yet, if I record the additonal steps of entering data into the load
balance record, playing these commands back crashes QuickDNS Admin.

I cannot make the following command work; it crashes QuickDNS Admin

make new Load Balance record at end of document 1

If I create a template file and open it, and if that template file contains
blank load balance records with the correct number of NS records and A
records for what I'm doing, things work correctly, but this is pretty kludgy.
Have I found a bug, or can someone educate me on the correct syntax for
creating and configuring new load balance records with QuickDNS Pro using
Applescript?

What follows is the full script in progress (warning! - this is pre-pre alpha
stuff)

On digest, please cc.

--------------------
property loadbalancedSubdomains : {"www", "demo"}

my createTowerCapDomain("test3.com")

on createTowerCapDomain(theDomain)
try
set AppleScript's text item delimiters to "."
set theDomainAsList to text items of theDomain as list
set AppleScript's text item delimiters to {}
on error
set AppleScript's text item delimiters to {}
end try
set theTopdomain to item -1 of theDomainAsList
if length of theDomainAsList = 3 then
set theSubdomain to (item 1 of theDomainAsList) as list
set theDomain to (item -2 of theDomainAsList) & "." & theTopdomain
end if

tell application "QuickDNS Pro Admin"
activate
-- uncommenting the following line causes a crash of QuickDNS Pro
Admin
-- make new document -- leave commented if a template is being used
set name of SOA of document 1 to (theDomain & ".") as string
set time to live of SOA of document 1 to ""
set primary of SOA of document 1 to "ns1.linkedresources.com."
set admin of SOA of document 1 to ("hostmaster." & theDomain & ".")
set serial of SOA of document 1 to "2000050500"
set refresh of SOA of document 1 to "28800"
set retry of SOA of document 1 to "7200"
set expire of SOA of document 1 to "604800"
set minimum ttl of SOA of document 1 to "86400"
make new NS record at end of document 1
set name of NS record 1 of document 1 to (theDomain & ".")
set server name of NS record 1 of document 1 to
"ns2.linkedresources.com."
make new NS record at end of document 1
set name of NS record 2 of document 1 to (theDomain & ".")
set server name of NS record 2 of document 1 to
"ns1.linkedresources.com."

make new MX record at end of document 1
set name of MX record 1 of document 1 to "mail"
set mailhost name of MX record 1 of document 1 to
"mail.linkedresources.com."

make new A record at end of document 1
set name of A record 1 of document 1 to "dev"
set IP number of A record 1 of document 1 to "208.42.69.122"
-- repeat with aSub in loadbalancedSubdomains
beep 2 -- poor man's debug, proves the script got this far
-- make new Load Balance record at end of document 1
set aSub to "www"

set infotext of Load Balance record 1 of document 1 to "Hosts: 0"
set name of Load Balance record 1 of document 1 to (aSub & "." &
"test3.com.")
set server name of NS record 1 of Load Balance record 1 of document 1
to "ns1.linkedresources.com."
set server name of NS record 2 of Load Balance record 1 of document 1
to "ns2.linkedresources.com."
set IP number of A record 1 of Load Balance record 1 of document 1 to
"208.42.69.121"
set IP number of A record 2 of Load Balance record 1 of document 1 to
"208.42.69.122"
-- end repeat
end tell
end createTowerCapDomain
-----------------

Jeff Baumann Pray for Elian
jwbaumann@aol.com Pray for Freedom
www.linkedresources.com



Messages In This Thread:



Return to Digital Point Solutions' Home Page