Actions in Networks

Hay all it’s me again mat
well this time it’s about what applscript can do in networks
some may not like what l want to do but l don’t care l’ll still post
now can anyone in here tell me the ablities that applescipt can do over a network i.e my school
…any abities l forget to put down the page
put here

I know u can shut down the computers
restart them
put them to sleep
but l want to know 3 things
1 any ablities l forgot
2 the script to do the list above from different computer
3 is it possible to make a display dialog on another computer from the one ur on? in a network?
-killsquad92-

You don’t need to bump your post, especially if it’s only been a few hours. (Posts deleted.)

Send Script to Another Computer
Display dialogs over the network
Documentation: References to Remote Applications (dated)

Thanx for actually posting back
and thanx for deleteing them
anywho l found somewhat of what l was looking for but l think l should have it seen by others just incase it won’t work.

this is the script here

set theMach to ("eppc://currUser:" & passW & "@" & IPnr of hh) as string
-- must be in the format "eppc://user:passw@ipnumber"

using terms from application "System Events"
   tell application "System Events" of machine theMach
       set fApp to some application process whose frontmost is true
       tell fApp
           activate
           beep 2
           set tB to button returned of (display dialog "hello")
       end tell
   end tell
end using terms from

now l think l under stand it but can some one explain it to the best of there ablitiy
so l’ll read wat l read from it
change currUser to student(school com for me) :" & passW(there is none) & “@” & IPnr of hh(thats where l go wrong(l don’t understand that one)) as string

using terms from application “system events”
tell app… “sys eve” of machine theMach(nope don’t got that part ethier just theMach part)
set fapp to some application process whose frountmost is true
tell fapp
activate
beep 2
set tb to the button returned of (display dialog "Hello)(wats with the () marks?)
end tell
end using terms from

ok can anyone explain wat l could not and if u have the time the whole thing if l have it all wrong
-killsquad92-

l did some looking around and found this:

set remoteMachine to "eppc://<ip.of.remote.machine>/"
tell application "System Events" of machine remoteMachine
   shutdown
end tell

well is there one for sleep?

set remoteMachine to “eppc://<ip.of.remote.machine>/”
tell application “System Events” of machine remoteMachine
sleep
end tell

could it be that simple?’

-killsquad92-

now can someone explain it l think l understand this one a little better but it’s still a little confusing :confused: to me
-killsquad92-

Ok l reread the scripts a few hundread more time and something in my head clicked, “still nothing”
na l think l understand them except
at my school l believe that we got a router or something like that so wouldn’t the ip be the same?
anyway could it be done via the computers name (lib-mac23)??
-killsquad92-

It’s easy enough to test a script and find out. If you aren’t on a network now, just use this:


tell application "System Events"
	sleep
end tell

It’s like in an equation - the part in parentheses needs to be worked out first. It can also be done like this:


display dialog "Hello"
set tb to result

From Bruce’s answer in the first link he posted:

l can get that but arn’t all the ip’s going to be the same?
-killsquad92-

First off why would l need the ip of a remote machine?
carn’t be done via the computers name in the network? the name would then be: “Lib-Mac23”

But l have made a script that could come in handy later that isn’t working for some reason

set temp1 to display dialog "Matt enter persons name" buttons {"Ok", "Nevermind"} default button 1 default answer ""
if the button returned of temp1 is "Nevermind" then
	set temp2 to display dialog "Your Loss Matt" buttons {"Leave"} default button 1
	if the button returned of temp2 is "Leave" then quit
end if
if the button returned of temp1 is "Ok" then
	set temp3 to display dialog "This is going to be fun" & return & return & "hahahahah" buttons {"Yes it will", "My mistake, NO"} default button 1
end if
if the button returned of temp3 is "My mistake, NO" then
	set temp4 to display dialog "Your Loss Matt" buttons {"Leave"} default button 1
	if the button returned of temp4 is "Leave" then quit
end if
set NamedaVic to text returned of temp1
if the button returned of temp3 is "Yes it will" then set temp5 to display dialog "Is this the name Of the Vic?" & return & NamedaVic buttons {"Yes", "No"} default button 1

if the button returned of temp5 is "No" then open application "IMservice"
if the button returned of temp5 is "Yes" then set temp6 to display dialog "Preset or modify the preset" buttons {"Preset", "Modify Preset"} default button 2
if the button returned of temp6 is "Preset" then set frog to display dialog "Hello" & return & NamedaVic & return & "don't try to run this is untraceable and to make it meaner if you run to a teacher l'll shut your computer down so you'll have no proof" & return & return & "If you will not tell etc etc put your left hand up" buttons {"Ok", "Stop"} default button 1 default answer "Hello" & return & NamedaVic & return & "don't try to run this is untraceable and to make it meaner if you run to a teacher l'll shut your computer down so you'll have no proof" & return & return & "If you will not tell, then turn around"
if the button returned of frog is "Ok" then set mess1 to text returned of temp7
if the button returned of temp6 is "Modify Preset" then set temp8 to display dialog "Hello" & return & NamedaVic & return & "don't try to run this is untraceable and to make it meaner if you run to a teacher l'll shut your computer down so you'll have no proof" & return & return & "If you will not tell then Turn around" buttons {"Done"} default button 1 default answer "Hello" & return & NamedaVic & return & "don't try to run this is untraceable and to make it meaner if you run to a teacher l'll shut your computer down so you'll have no proof" & return & return & "If you will not tell, then turn around"

if the button returned of temp8 is "Done" then set mess1 to text returned of temp8


tell application "Finder"
	activate
	display dialog "" & return & mess1
end tell

basiclly if u carn’t understand it or didn’t read it it is a mass of display dialogs that gets the persons name from the yourself and then has a preset message or a preset message which is to be modifyed but so l could detrmine whichi was which l made them the same but with different names as u’ll see now if u run the script u’ll see that varible temp7 is not defined and well l have clearly define it and thats why l’m comeing to u guys wat am l missing?
well basiclly l haven’t finished that script but wats going to happen after it is the preset or modifyed message is going to be the text returned “text1”
and then text1 is them going to be the message seen by the other user that l send it to instead of me making a whole entire script this thing has some preset l made + l’ll be making another where is does again gets there name + adds watever l say to it to them
un…yea so basiclly can someone first fix my first script
then add it to

set theMach to ("eppc://currUser:" & passW & "@" & IPnr of hh) as string
using terms from application "System Events"
	tell application "System Events" of machine theMach
		set fApp to some application process whose frontmost is true
		tell fApp
			activate
display dialog "hello" & NamedaVic & return & text1
		end tell
	end tell
end using terms from

so basiclly it’s a instant messageing system that is basiclly one way and later l’ll see if l can make it 2 way and then l’ll put it into a application and put it on here
-killsquad92-
so yea this is basiclly the skeleton of what l want:

  • an instant message thing
    -the thing of display dialogs l made to be fixed and then attached to the send to different com
  • l’ll make another pack of display dialogs tomorrownight that will be a simple message with yet there name again and sent to a diff com once all this goes well l’ll make it 2 way
    thanx
    anyone feel free to help or take ideas or put ur ideas in here
    l feel slightly grown up writeing all this, nope l’m finished now

Some one plz add a script to find the ip of a machine
thanx
-killsquad92-

You don’t need new posts to know if anybody is reading this thread. At the time I started posting this reply, there had been 137 views of this thread. Go to Index >> AppleScript | OS X and check the views column.

As to why you aren’t getting more replies, well… one can only speculate. It could be that not many people want to waste their time helping you distract other students and possibly shut down their computers.

I’ll offer one suggestion. Remember that for many, English is a second (or third) language. At times, your posts can be difficult for native English speakers to decipher.

I had to read that part of your post a number of times before it even began to make sense. People are willing to take the time to help - so don’t waste their time. You’ll get better results.

j

You can use AppleScript to target either local or remote applications, so there isn’t really a list of things that AS can do over a network. You must keep in mind that Remote Apple Events must be enabled (and allowed through any firewalls) and that any remote applications must already be running (which was mentioned in those links I posted).

¢0|_|1|) u ℘1z ℘0$ Η@ $3℘3®@ 31¥ â‚­ Η⊗

Er, what I meant to say was. That question would probably get a better response in a seperate topic. Would you post it seperately?

Is there any reason you can’t use iChat over Bonjour?

I meant to answer this in my last post.

The variable temp7 is undefined because text is returned from the dialog you named “frog”.

Ok l saw what l wrote and l gave you the wrong script that was the second one l tryed it 3 times and failed all that one l tryed a different name and rearanged them all don’t worry on the display dialog thing anymore l’ll have to get rid of it and make a new one .
um…has anyone found a way of sending the display dialog of a network not useing the ip??

-killsquad92-

Unless l’m doing someting wrong this isn’t work to send it to myself

set theMach to ("eppc://currUser:" & passW & "@" & IPnr of hh) as string
using terms from application "System Events"
	tell application "System Events" of machine theMach
		set fApp to some application process whose frontmost is true
		tell fApp
			activate
			display dialog "hello" & NamedaVic & return & text1
		end tell
	end tell
end using terms from

l out in “eppc://(this current user):” & passW & “@” @ IPnr & hh)

ok well l delete the whole thing and where the stars are l entered the correct stuff
eppc://****:" & ***** & “@” & *********) thats what l put in what am l missing?
-killsquad92-

I get an error:

Well thats a **** script anyone got a script that works?
-killsquad92-

Maybe Remote Apple Events doesn’t allow user interaction.

hi killsquad,

check out my scanner here:

http://bbs.applescript.net/viewtopic.php?id=18020

it might help you with ip addresses and machine names. i don’t know about sending Apple Events over the network.

Thanx Waltr, l don’t know if it will help me cause l’m on a PC at school but when l get home it’s the first thing l’ll be doing,
and Bruce it is possible my elder brother once did it here on the same computers but he only had the script written down on a peice of paper by one of his friends, 5 years on l want to do the same but have an understanding of applescript.
l’ll google this and ask my brother if he can remember any more and get back to you with the results of the perivious script (waltr’s)
-killsquad92-

I went and read the ‘whats going to happen’ at the bottem of the script and l understood most of it, but one thing l got confused with is how that script helps me, it’s probly that l haven’t try the script yet so yea l have to try it
-killsquad92-