• 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: can't find error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't find error


  • Subject: Re: can't find error
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 04 Feb 2015 21:37:52 +0100


Le 04/02/2015 à 20:02, Robert Poland <email@hidden> a écrit :

Hi,

I have this small part of a large script that when by it’s self it works.

But when as part of the larger script I get the error “The variable processlist is not defined”.

It is used several times and only fails late in the script.

I have rebooted and restarted Smile and Script Editor several times.

Any ideas?


<script>
tell application "System Events"
delay 0.3
set processlist to name of every process
delay 0.3
if processlist does not contain "Skype" then
repeat while processlist does not contain "Skype"
tell application "Skype" to launch
delay 0.3
set processlist to name of every process
end repeat
end if # does not contain "Skype"
end tell # System Events
beep
</script>

TIA,

Robert Poland
Fort Collins CO



Other track

I don't like to change the value used by a test in the code with it drives.
Assuming that processlist must be used later I would code :

<script>
tell application "System Events"
delay 0.3
set processlist to name of every process
delay 0.3
if processlist does not contain "Skype" then
repeat
tell application "Skype" to launch
delay 0.3
set processlist to name of every process
if processlist contains "Skype" then exit repeat
end repeat
end if #processlist doesn't contain…
end tell # System Events
beep
</script>

As I dislike to encapsulate a tell to an application into a tell to an other one, I would edit as :

<script>
tell application "System Events"
delay 0.3
set processlist to name of every process
end tell # System Events
delay 0.3
if processlist does not contain "Skype" then
repeat
tell application "Skype" to launch
tell application "System Events"
delay 0.3
set processlist to name of every process
end tell # System Events
if processlist contains "Skype" then exit repeat
end repeat
end if #processlist doesn't contain…
beep
</script>

Yvan KOENIG (VALLAURIS, France) mercredi 4 février 2015 21:37:46





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >can't find error (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: can't find error
  • Next by Date: Re: can't find error
  • Previous by thread: Re: can't find error
  • Next by thread: Re: can't find error
  • Index(es):
    • Date
    • Thread