English 中文(简体)
2. 包装地址
原标题:Applescript setting ip address

我希望用补充文字来改变我角的地址。 因此,我写了一幅将自动做的文字,但是,在建立议会地址方面存在着问题。

set ipAddress to "192.168.110.48"
tell application "System Preferences"
 activate
 set current pane to pane id "com.apple.preference.network"
end tell
tell application "System Events"
 tell process "System Preferences"
  click checkbox "Click the lock to make changes." of window "Network"
  tell application "System Events" to keystroke "p"
  tell application "System Events" to keystroke "a"
  tell application "System Events" to keystroke "s"
  tell application "System Events" to keystroke "s"
  tell application "System Events" to keystroke "w"
  tell application "System Events" to keystroke "o"
  tell application "System Events" to keystroke return
  click button 11 of window "Network"
  tell window "Network"
   tell sheet 1
    tell tab group 1
     click radio button "TCP/IP"


     set contents of text field 2 to ipAddress



    end tell
   end tell
  end tell



 end tell
end tell

Everything executes fine except for this statement

"set contents of text field 2 to ipAddress"

我正在犯以下错误:

error "System Events got an error: Can’t set contents of text field 2 of tab group 1 of sheet 1 of window "Network" of process "System Preferences" to "192.168.110.48"." number -10006 from contents of text field 2 of tab group 1 of sheet 1 of window "Network" of process "System Preferences" I checked the UI elements using UIBrowser so i am sure that i am using the correct elements. What is causing the problem? and Also can u tell a better way to write the same thing?

问题回答

改变知识产权的一种替代解决办法是利用网络的网点特征并使用预先界定的地点。

如果你点击网络顶点的Peoples中的Peoples,你会发现一个名为“地点”的 men。 浮标和选择Edit 地点......

然后,你可以建立一个新的地点,并装配一个接口,无论是外联网、机场、消防、3G卡等。 你们可以有多个地点进行同一接口。 因此,你可以有一个有192.168.2.2的IP的乙醇基点,然后你可以有另一组,即192.168.2.3。

一旦你们所有新地点都贴上标签,你就能够使用阿普兰代谢在它们之间的洞察力。

1. 取得阿普果文中你目前的网络位置,使用以下代码:

set currentLocation to do shell script "networksetup -getcurrentlocation"

选择一个新地点,使用以下《 Apple本》:

set newLocationName to "whatever location you want to choose"
do shell script "scselect " & newLocationName with administrator privileges

采用上述方法,你可以创造许多预先界定的网络地点,并方便地与你的 Apple本相接触。 此外,你可以随机抽出一个与贵处所有地点一起的“果普朗”表。

• 利用网络手稿人工安装IP:

do shell script "networksetup -setmanual Ethernet 192.168.110.48 
255.55.255.0 192.168.110.1 password YOURPASSWORD with administrator privileges"

回到人权方案:

do shell script "networksetup -setdhcp Ethernet YOURPASSWORD 
with administrator privileges"

当然,你可以操纵插头,使用变量,并将“Ethernet”改为任何接口(如Wi-Fi)。

这是一个关键词错误。

<代码>案文领域2至ipAddress的内容不是适当的指挥

the right command is

<代码> 文本领域2至pAddress的价值

欢乐!





相关问题
Creating Help Files - Applescript Studio

I would like to know how to generate help files for an applescript studio application I am currently creating. I have tried many different options of creating help, and googled it for quite some time ...

封顶下载和开放式链接

I ve在Angap邮报中设定了一条规则,以操作“Download & Openlink”pple。 我希望这一文字在邮件电文中下载该词,在下载该词之后,该词应开放。

AppleScript to open named terminal window

I have two windows/tabs set up to run in Terminal.app, "syd" and "mel". i.e. in Shell | New Window, "syd" and "mel" are listed. How can I open these terminal configurations with AppleScript?

Hello World Error

I m learning AppleScript and my first program is a Hello World(of course!): display dialog "Hello World" But when I try to run this I got the error: The result of a numeric operation was too ...

User properties/ privileges in AppleScript

I want to write an applescript program that first checks to see if the user has Admin privileges, and if it doesn t then requesting a re-log-in or something. Eventually the script is going to need to ...

Applescript to archive email in Mail.app

I need to write an Applescript for Mail.app that will take all messages in my Inbox and Sent Messages that are older than a certain # of days and move them into respective folders "On My Mac", or ...

热门标签