• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How Do I Make It Work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How Do I Make It Work


  • Subject: Re: How Do I Make It Work
  • From: Ezra Balaraj <email@hidden>
  • Date: Mon, 12 Jan 2004 13:32:11 +0800

> If you look at the structure of your code it goes something like this:
>
> tell application "Internet Connect"
> -- code here to work out the config to use
> end tell
>
> activate
> connect
>
> tell application "Safari"
> -- code here to open a URL
> end tell
>
> You'll notice that the commands 'activate' and 'connect' are outside any
> application tell block, therefore these commands are not sent to any command
> and your script will try to execute them itself. Since your script doesn't
> know what to do with a command 'connect', it gives you an error.
>
> The solution is simple. Just move these commands into the tell block
> corresponding to the application you want to run them. In this case since
> you want Internet Connect to 'connect', you need to move this command before
> the 'end tell' (you don't need the 'activate' command at all.
>
> As for telling it to quit when done, add a 'quit' statement inside the tell
> block for the application you want to quit.
>
> Andrew
> :)
>
> On 1/11/04 4:51 AM, "Ezra Balaraj" <email@hidden> wrote:
>
>> Hello,
>> I am an absolute newbie. I got this from another forum. I want to use it as
>> a start-up item. Please, how do I make it work for me? The error msg. refers
>> to the 3variable=connect2 not being defined. I also want it to quit after it
>> has done it9s work. Thank you.
>>
>>
>> property myConfig : "Built-in Ethernet"
>>
>> tell application "Internet Connect"
>> -- get the current configuration
>> if name of current configuration is not equal to "Built-in Ethernet"
>> then
>> ,
>> set configList to every configuration
>> set configNames to name of every configuration
>>
>> repeat with i from 1 to count of configNames
>> if item i of configNames is equal to myConfig then
>> set current configuration to item i of configList
>> exit repeat
>> end if
>> end repeat
>> end if
>> end tell
>>
>>
>> activate
>> connect
>>
>>
>>
>> tell application "Safari"
>> activate
>> -- OpenURL to some places
>> end tell
>> _______________________________________________
>> applescript-users mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>> Do not post admin requests to the list. They will be ignored.
>
>
Hello Andrew,

Thank you very much. Now, I understand how this works! You explain it very
well indeed. Thank you once again.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How Do I Make It Work (From: Andrew Oliver <email@hidden>)

  • Prev by Date: re: Hiding Application Processes
  • Next by Date: Re: parsing Unix date
  • Previous by thread: Re: How Do I Make It Work
  • Next by thread: Re: How Do I Make It Work
  • Index(es):
    • Date
    • Thread