Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
Blaubeere •->


Anmeldedatum: 21.02.2001 Beiträge: 11 Wohnort: Trier
|
Verfasst am: 05.05.2001 - 01:06 Titel: An Snow - Network Setup Scripting |
|
|
Hallo Snow,
Du hast mir mal im Februar geholfen wegen eines Scripts, mit dem ich Remote Access starten kann. Da ich nun mit OS 9.1 arbeite, muss ich das Script umschreiben auf die Befehle von Network Setup Scripting. Ich habe es versucht, aber es klappt nicht. Irgend etwas fehlt noch, aber ich weiß nicht, was. Hier das Script:
----------
set DerStatus to ""
tell application "Finder"
repeat until DerStatus is "Verbunden"
set DerStatus to activity --hier fehlt etwas
try
connect --und hier fehlt auch etwas
end try
end repeat
end tell
----------
Darf ich Dich nochmal um Hilfe bitten?
Vielen Dank im voraus. _________________ Blaubeere |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 05.05.2001 - 11:18 Titel: An Snow - Network Setup Scripting |
|
|
Hallo Blaubeere,
ich habe hier mal das entsprechende Skript aus dem AppleScript Guidebook.
set the config_name to "My Company Remote Connection (Toll free)"
set the wait_amount to 180 -- length of time (in seconds) to monitor connection
set the delay_time to 10 -- length of time (in seconds) between status checks
set the num_queries to (the wait_amount div the delay_time)
set the transaction_ID to ""
try
tell application "Network Setup Scripting"
open database
set the transaction_ID to begin transaction
-- check for and activate the configuration
if (exists Remote Access configuration the config_name) then
set active of Remote Access configuration ¬
the config_name to true
else
error "This configuration does not exist: " & ¬
config_name
end if
end transaction
-- start the connection process
connect Remote Access configuration config_name
-- check the status
repeat num_queries times
set current_status to the status of ¬
Remote Access configuration config_name
set the msg to the message of the current_status
-- say msg
if the activity of current_status is in ¬
{ connected, idle } then
exit repeat
else
delay delay_time
end if
end repeat
close database
end tell
on error error_message
try
tell application "Network Setup Scripting"
if the transaction_ID is not "" then abort transaction
close database
end tell
end try
tell application (path to frontmost application as text)
display dialog error_message buttons { "OK" } default button 1
end tell
end try
In der ersten Zeile musst du den exakten Namen deiner Remote Access Configuration eingeben.
Die Zeile "say msg" habe ich auskommentiert, falls du die Spracherkennung nicht im System hast.
Das Skript versucht 3 Minuten lang, im Abstand von 10 Sekunden, eine Verbindung herzustellen. Die Zeiten können natürlich geändert werden. _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com
Zuletzt bearbeitet von Snow am 27.02.2003 - 00:29, insgesamt einmal bearbeitet |
|
Nach oben |
|
 |
Blaubeere •->


Anmeldedatum: 21.02.2001 Beiträge: 11 Wohnort: Trier
|
Verfasst am: 05.05.2001 - 17:22 Titel: An Snow - Network Setup Scripting |
|
|
Wow, recht herzlichen Dank, Snow! Ich werde mir das Script mal in einer ruhigen Miunute ansehen.
Blaubeere _________________ Blaubeere |
|
Nach oben |
|
 |
Blaubeere •->


Anmeldedatum: 21.02.2001 Beiträge: 11 Wohnort: Trier
|
Verfasst am: 05.05.2001 - 23:13 Titel: An Snow - Network Setup Scripting |
|
|
Hallo Snow,
Dein Script hat einen Fehler. Es steigt in der Zeile
set current_status to the status of ¨
Remote Access configuration config_name
aus. Ich kopiere mal das Eventprotokoll hier hin:
tell application "Network Setup Scripting"
open database
begin transaction
--> -249
exists Remote Access configuration "T-Online 3.0 Einwahl"
--> true
set active of Remote Access configuration "T-Online 3.0 Einwahl" to true
end transaction
connect Remote Access configuration "T-Online 3.0 Einwahl"
--> 1
get status of Remote Access configuration "T-Online 3.0 Einwahl"
abort transaction
abort transaction
end tell
tell current application
path to ´constant afdregfpª as text
--> "Nr. 1:Applications (Mac OS 9):Apple Extras:AppleScript:Skripteditor"
display dialog "Network Setup Scripting got an error: AppleEvent timed out." buttons {"OK"} default button 1
--> {button returned:"OK"}
end tell
Hast Du eine Idee, was los ist? Die Verbindung ins Netz kommt zustande, aber die Abfrage des Status scheitert.
Blaubeere _________________ Blaubeere |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 06.05.2001 - 01:41 Titel: An Snow - Network Setup Scripting |
|
|
Hallo Blaubeere,
jetzt muss ich leider passen.
Ich habe das Script auf meinem PowerBook getestet, da läuft es. (Allerdings unter OS 9.0.4 - AS 1.4.3)
Unter OS 9.1 mit AS 1.6 kann ich es nicht testen, da ich an meinem G3 den Sagem Planet Geoport Adapter benutze.
Das läuft ja über die Sagem-Software und nicht über Remote Access.
Du könntest höchstens mal versuchen, den Time-Out-Wert zu erhöhen. Dann siehst du, ob die Status-Abfrage überhaupt klappt oder nicht.
with timeout of 600 seconds
set current_status to the status of ¨
Remote Access configuration config_name
end timeout
Gruß _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|
Nach oben |
|
 |
Blaubeere •->


Anmeldedatum: 21.02.2001 Beiträge: 11 Wohnort: Trier
|
Verfasst am: 06.05.2001 - 23:51 Titel: An Snow - Network Setup Scripting |
|
|
Hallo Snow,
offensichtlich bin ich da auf einen (bekannten) Bug gestoßen. Bei Theapplescriptsourcebook heißt es (http://www.applescriptsourcebook.com/applescript/applescript155.html#newbugs):
"On January 19, 2001, Chris Nebel confirmed on the AppleScript-Users mailing list a reported bug in Mac OS 9.1 in which the Status property in the Remote Access configuration class defined in Network Setup Scripting does not work correctly."
Dies bezieht sich zwar auf AppleScript 1.5.5, aber offensichtlich ist der Bug in Version 1.6 noch nicht behoben worden.
Da kann man nichts machen außer warten...
Eine Frage am Rande: was machst Du eigentlich beruflich, Snow?
Gruß _________________ Blaubeere |
|
Nach oben |
|
 |
|