Search Again:

Appletalk QDNS Admin Bug

From: Patrick Langer
Date: Sunday, September 17, 2000
Time: 3:56:05 am

Hi!

I've made an AppleScript to sync my primary and secondary server. With
OS 9, it works like a charme, but:
as soon as the script is finished and closes the secondary domains
window on the secondary server, Admin will crash with unexpected error
3. Nevertheless, Sec domains are actually saved. It also crashed when I
try to close the window manually after the script made the new entries.

I'll post the script here. It may not be the best code, but beside he
forementioned effect, it works:


---8<------8<------8<------8<------8<------8<------8<------8<------8<----=
--8<------8<---
property primaryServer : "192.168.1.100"

on run
tell application "Finder"
set AdminApp to application file id "QDNS"
set QDNSFolder to folder of AdminApp
set PDFolder to folder "Primary Data" of folder "QuickDNS Data" of QDNS=
Folder
set PDFiles to every item of PDFolder as list
tell application "QuickDNS Pro Admin"
if (count of (every window)) > 0 then
close every window
end if
open file ((QDNSFolder as text) & "QuickDNS Data:Secondary Domains")
if (count of every SD record of document 1) > 0 then
set SDData to the name of every SD record of document 1 as list
else
set SDData to "" as list
end if
end tell
if (count of PDFiles) > 0 then
repeat with thefile in PDFiles
set filename to the name of thefile
if SDData does not contain filename then
my processFile(thefile as text)
end if
end repeat
end if
(* tell application "QuickDNS Pro Admin"
save document "Secondary Domains"

close document "Secondary Domains" saving yes =

end tell *)
end tell
end run

on processFile(thefile)
tell application "Finder" to open alias thefile
set remote_Finder to application "Finder" of machine "eppc://192.168.1.1=
01"
set remote_app to application "QuickDNS Pro Admin" of machine "eppc://19=
2.168.1.101"
using terms from application "Finder"
tell remote_Finder
-- pass the creator code of the target application
open application file id "QDNS"
end tell
end using terms from
=

using terms from application "QuickDNS Pro Admin"
tell remote_app
if thefile is not "Secondary Domains" then
tell document 1
tell SOA
set theName to name
set thefile to my fixName(theName)
end tell
end tell
make new SD record at the end of =AC
document "Secondary Domains" with properties =AC
{name:theName, filename:thefile, first IP number:primaryServer} =AC
=

end if
close document 1
end tell
end using terms from
end processFile


on fixName(name)
if length of name > 29 and length of name < 32 then
set name to name & " "
end if
set name to "sns" & name
return name
end fixName

---8<------8<------8<------8<------8<------8<------8<------8<------8<----=
--8<------8<---

I changed the IP adresses as the machines are actually in 2 different
class-C nets (thats why applescripting via TCP/IP).


-- =



mfg,

P. Langer
Vertrieb Uhlmann GmbH
Tel: 0711-13898-127
Fax: 0711-13898-200
http://www.uhlmann.net



Messages In This Thread:



Return to Digital Point Solutions' Home Page