System Events got an error: Can't get current configuration of service?

I'm trying to connect/disconnect services through apple script, here is the error I'm getting for "Ethernet" "AirPort" (these services are configured in services tab)
I am able to manualy On/Off these services without supplying admin password, therefore it might not be privilages issue.
*Error message:*
*System Events got an error: Can’t get current configuration of service id "099F7D16-4F3A-4D49-9111-A4DF0A645378" of network preferences.*
Scipt used:
tell application "System Events"
tell network preferences
tell current location
get the name of every service
set myService to service "AirPort"
if exists myService then
--get service properties of myService
set isConnected to connected of current configuration of myService
if isConnected then
disconnect myService
repeat while (get connected of current configuration of myService)
delay 1
end repeat
end if
connect myService
end if
end tell
end tell
end tell

Hi Damian and welcome to Apple Discussions!
One suggestion: try
tell application "Finder" to open item 1 of docs
(without 'using "Corel Painter 8"')
As far as the Finder is concerned, "Corel Painter 8" is just a string of characters. And telling the Finder to open a file is just the same as double-clicking it: the Finder knows which app to use - as long as these are native Corel Painter 8 docs.
Hope this helps,
H

Similar Messages

  • Startup error message:System Events got an error: NSInternalScriptError (8)

    I just upgraded from Panther to Tiger on my mac Mini and I can't seem to get rid of this message everytime I boot up:
    System Events got an error: NSInternalScriptError (8)
    Any idea how I can "fix" this?
    Much thanks.

    Do you have any login items listed in the Accounts pane of your System Preferences? If so, disable them and restart to see if that clears the message. If so, then re-enable them one by one and restart to see which one it is.
    In doing a Google search, that message appears to come from an AppleScript. So perhaps you have an AppleScript running at login that needs to be modified to be compatible with Tiger...
    charlie

  • Finder got an error: Can't get item 1 of {document file "foo" ...}

    I have a lot of files in Corel Painter 8's RIFF format. I want to write a script that opens a file and somehow forces Corel Painter 8 to save the file as a GIF. GUI scripting may be some help with the latter; now I am concentrating on finding RIFF files and opening them in Corel Painter 8.
    I have a script that does a depth-first search of the folders starting at some root folder, using the Finder application to do the file-system stuff. It creates a list with
    set docs to every document file of pages_folder whose file type = "RIFF"
    as it loops through folders it adds to the list like this:
    set more_documents to every document file of a_folder whose file type = "RIFF"
    set docs to docs & more_documents
    My naîve mental model is that docs is a list of document-file objects. Next I have a loop that attempts to strip out files for which a GIF file already exists (and is no older than the RIFF document). This works by deleting non-matching items like so:
    if not isgifneeded then
    set docs to items 1 thru (i - 1) of docs & items (i + 1) thru (length of docs) of docs
    end if
    Finally it tries to open one of the files in Corel Painter 8 using the Finder:
    open item 1 of docs using "Corel Painter 8"
    This does not work. I get an error message
    Finder got an error: Can't get item 1 of {document file "bar" of folder "foo" of folder "blah" of folder "pdc" of folder "Users" of startup disk, ... }."
    It lists all of the files. (The error message appears in a sheet that extends off the bottom of the screen!) They are identified in the message as document-file objects. The curly braces are, I believe, the AppleScript notation for a list. I expect to be able to obtain the first element of a list with ‘item 1 of xs’. My assumption is that the Finder’s open command would expect a document file object, or at least would be able to cope with being asked to open a document. What am I missing here?
    PowerBook 12" without mini-DVI   Mac OS X (10.4.7)  

    Hi Damian and welcome to Apple Discussions!
    One suggestion: try
    tell application "Finder" to open item 1 of docs
    (without 'using "Corel Painter 8"')
    As far as the Finder is concerned, "Corel Painter 8" is just a string of characters. And telling the Finder to open a file is just the same as double-clicking it: the Finder knows which app to use - as long as these are native Corel Painter 8 docs.
    Hope this helps,
    H

  • Applescript for mail error can't get message id

    I have an applescript (found on internet) for Mail 4.5 that deletes messages in "on my mac" mailbox "Deleted Inbox" that are older than 120 days. The script runs from an iCal daily event. I drag messages from Inbox to "Deleted Inbox" when I don't want the message in Inbox, but I want to save the message for 120 days before deleting it. The script sometimes runs successfully, and sometimes gives error "Mail got an error: Can't get message id xxx of mailbox "Deleted Inbox"". Then in Mail, I "Mailbox / Rebuild" that mailbox, and run the script manually without error. How can I avoid that error? The script is essentially:
    tell application "Mail"
              set OldStuff to every message of mailbox TheBox where date received of it < OldDate
              repeat with ThisMessage in OldStuff
        delete ThisMessage
              end repeat
    end tell
    Thanks for any help.
    Ken

    How can I avoid that error?
    I don't actually know how you can avoid that error. However, maybe you can use a workaround and have the script rebuild the mailboxes automatically when such an error occurs. Try the following code:
    tell application "Mail"
      try
        set OldStuff to every message of mailbox TheBox where date received of it < OldDate
      on error
        activate
        tell application "System Events" to click menu item "Rebuild" of menu 1 of menu bar item "Mailbox" of menu bar 1 of process "Mail"
        delay 1 -- adjust if necessary
        set OldStuff to every message of mailbox TheBox where date received of it < OldDate
      end try
      repeat with ThisMessage in OldStuff
        delete ThisMessage
      end repeat
    end tell
    Since the above script uses GUI Scripting, you must enable the Accessibility Frameworks by clicking the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane.
    Message was edited by: Pierre L.

  • "iCal got an error: Can't Make id of event of calendar 4 into type referen

    Hello everyone. i am completely new to MAC's and very new to scripting. Thanks in advance for any help.
    I am tying to run an Apple Script that is called Scheduled Delivery.
    I'm running 10.4.10 and have the most recent version of the script.
    Basically what happens is I type up and email, add in the email address and save it to my drafts folder. The Scheduled Deliver script, when run, finds all the emails in my drafts folder and uses iCal to schedule a time to mail them (which is a specific time I enter)
    Here is my process I go through-
    I run the apple script by double clicking on the Scheduled deliver Icon, which was in my appications/MailScript folder. It brings up a new window with all my saved drafts. I select the draft I want to schedule a specific time to deliver. This is great.
    When I click on the lower right button "Update Schedule" I get an error message...
    "iCal got an error: Can't Make id of event of calendar 4 into type reference. (-1700)"
    I cannot figure this out. I've tried testing it anyway. I can close the Scheduled Deliver window but the "Done" button is always grey out. It seems to place an event in iCal but no message ever gets sent.
    Any help is greatly appreciated.
    Thanks

    Anyone? Any help is greatly appreciated.

  • Applescript "Finder got an error: Can't make document file"

    I can get the file contents if I use choose file but if I do it this way, I get the error:
    error "Finder got an error: Can’t make document file ... to file
    Code:
    tell application "Finder"
              set theFolder to (choose folder with prompt "Select the start folder")
              set file_list to every file of theFolder
              repeat with myfile in file_list
          log (name of myfile as string)
          set fileContents to read myfile
          set fileText to paragraphs of (fileContents)
          repeat with nextLine in fileText
              if length of nextLine is greater than 0 then
                  log nextLine
              end if
          end repeat
              end repeat
    end tell

    Changing
    set fileContents to read myfile
    to
    set fileContents to read (myfile as alias)
    sorted it!

  • IChat Error: "Can't get video from the camera"

    When I try to Screen Share with iChat on a local network, I receive the error "Can't get video from the camera" when I have an external camera plugged into the FW400 port on my Mac Mini. The Screen Sharing feature works great when the camera is not connected. Anyone know why this is and how to fix it?

    Tell us about the Network you created please.
    What make and model modem ?
    Can it route (issue IPs) ?
    IS there a router ?
    Make and model of that please ?
    If there are two devices which is doing DHCP if any are ?
    IS there any computer that is sharing it's Internet Connection with any other computer ?
    I take it from the title and the post that you infer you can Video and Audio chat ?
    The Cannot get Video from Camera normally gets and Error Log pop up.
    This can be opened with the reveal triangle on the left. The Details shown will have a Error number. Do you know what this log says ? (normally Error 20 or 21)
    Old logs are stored in Users/(your account)/Library/Logs/iChatConnectionErrors by date.
    IF you post an Error Log stop at the line that Says "Binary Images for iChat" as we don't need the bits below that yet.
    As the Screen share in iChat uses an Audio component then the Camera if it is also the Mic needs to be ON.
    In your case this may mean that in the ichat Video Menu both Camera Enabled and Mic Enabled should both be ticked.
    (I have never seen an iChat error code for not (specifically) being able to get the Mic input so the message might be the only one iChat can pop up)
    It does seem very odd that it only effecting Screen Sharing.
    I have a Firewire connected DV converter that has two Firewire ports itself so I can input the camera feed to two computers. When this is in place the System also sees it as a Network.
    I have also heard of one person with a Firewire Stills camera and I think the Storage space was seen as an External Device and therefore appeared Networked which is why I asked the first set of questions.
    iChat does not like being in Two networks (a modem that issues IP address and a router doing the same or Wireless to a neighbour and Ethernet to your Own Internet connection, the Mac being the hub in a Share Internet connection, Wireless and Ethernet to the same router and using Parallels when set to Share the Mac's IP are the most common)
    The Screen Sharing option in iChat > Video Menu is ON ? (at both ends ?)
    As iChat's Screen Sharing is related to the System Screen Sharing and therefore Apple Remote Desktop you may find that in any routing device you may have to open ports 5900 and 5988 if not using UPnP
    http://support.apple.com/kb/TS1629?viewlocale=en_US
    You said Local Network. Do you mean this is using the Bonjour Buddy List ?
    11:21 AM Saturday; June 14, 2008

  • I bought a new laptop because my old laptop got lost,how can i get my iphone to synch on it.

    I bought a new laptop because my old laptop got lost,how can i get my iphone to synchronize with my new laptop?

    Have you transferred your iTunes library from your computer's backup to your new computer along with all other important data such as documents, photos, etc.?

  • Import Issue : "Database error: can't get path to master" when attempting to import photos (referenced method)

    Hi Everyone,
    I have a NAS (Network Attached Storage) which holds my photos. I want to import them into Apple photos (but via the reference method).
    I did this by going to Preferences/General and unchecking the 'Importing: Copy items to the Photo library' option.
    I connect to my NAS via AFP and have mount 'Media' which is where my photos are stored.
    I select the file/import option, navigate to aforementioned photo location and select the "Review for import" button
    I then receive an error which states:
    Unreadable File
    The following files could not be imported (they may be an unrecognized file type or the files may not contain valid data).
    Filename                    Reason
    Filename.jpg              Database Error: can't get path to master
    The above error happens on multiple file types.....
    However ...
    If I tick the option in the preferences/general to 'Importing : Copy items to photo library" option then the file will import successfully.
    I of course don't want to import the files I want them to be referenced...
    Anyone else experiencing this issue????
    Thanks in advance.
    Benjamin

    If this is a 3rd party application, I would seek out that company and ask for an updated version compatible with 2010, then it would be a matter of simply installing it per their instructions.
    Otherwise, the best course of action is to deactivate the feature from WSSv3 prior to removal. If that is no longer possible, then use
    FeatureAdmin to remove the feature from within 2010.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Rsh[3088]: [ID 365563 daemon.error] can't get stderr port in /var/adm/mes..

    Hi,
    We are using Solaris 9 in our SF6900 cluster. On one of the node we are getting below continuous flow of messages. Please let me know what does these messages means and how to clear them.
    root@l7n2> tail -f /var/adm/messages
    Aug 8 09:09:34 l7n2 rsh[3071]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3075]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3077]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3078]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3082]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3084]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3085]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3086]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3087]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    Aug 8 09:09:34 l7n2 rsh[3088]: [ID 365563 daemon.error] can't get stderr port: Cannot assign requested address
    ^C
    Thanks.

    Hi Tom,
         Thanks, but at this point, I've rebooted, checked and double-checked more times than I'd care to count...:(
         Since I can see the NMEA strings when the GPS module is hooked-up to the USB port, I guess I'll assume there's some reason why the
         AMA0 UART has not been released, or that the GPS receives some different signals through the TTY that it's not seeing through the AMA0.
          As I mentioned, when I use 'cat /dev/ttyAMA0', it just hangs, like it's getting no data. I'll keep looking...
         Thanks for your help,
              Dave

  • HT201272 My laptop pc got stolen, how can I get hold of all the itune music I purchased, or at least get a list for insurance?

    My laptop pc got stolen, how can I get hold of all the itune music I purchased, or at least get a list for insurance?

    Yu can try this program.  If unsuccessful, the contents of the iPod will be deleted if yu update/restore with the iPod in recovery mode.
    RecBoot: Easy Way to Put iPhone into Recovery Mode | Jaxov

  • I am using iphone 5s, glass got broked, where can i get the original panel and what would be price

    i am using iphone 5s, glass got broked, where can i get the original panel and what would be price

    If you are from India ,here is how you get Out of Warranty service in India
    Out-of-Warranty Service
    Please contact an iPhone Authorized Service Provider for out-of-warranty service options.

  • [ID 365563 daemon.error] can't get stderr port: Cannot assign requested add

    Hello friends, i m getting the messages bellow in error logs, please suggest me what i have to do
    " [ID 365563 daemon.error] can't get stderr port: Cannot assign requested add"

    Hi Tom,
         Thanks, but at this point, I've rebooted, checked and double-checked more times than I'd care to count...:(
         Since I can see the NMEA strings when the GPS module is hooked-up to the USB port, I guess I'll assume there's some reason why the
         AMA0 UART has not been released, or that the GPS receives some different signals through the TTY that it's not seeing through the AMA0.
          As I mentioned, when I use 'cat /dev/ttyAMA0', it just hangs, like it's getting no data. I'll keep looking...
         Thanks for your help,
              Dave

  • I have been transfeing my DVD footage to I movie using handbreak and the spinning wheel of death has arrived and locked up I movie as I tried to import footage.  The message says, "Optimizing movies, processing event DVD" but I can't get out of it.

    I have been transfeing my DVD footage to I movie using handbreak and the spinning wheel of death has arrived and locked up I movie as I tried to import footage.  The message says, "Optimizing movies, processing event DVD" but I can't get out of it.

    Yes I held them down till the apple logo appears, then spinning wheel and repeated boot up process. I only knew it was going round in circles because the charging sound kept repeating every so many seconds.
    I am downloading iOS.5.0.1 now to do a complete factory restore. I hope this works. I have been looking online for hours for fixes and I have very little batter on it as its been spinning for hours now.
    Why do things like this happen? I am sat there watching tv and one minute the settings folder is there then its not! How does that happen? It just disappear? I hadn't moved it to another folder or deleted it, it just.... went!

  • How can i get current time of a given timezone

    how can i get current time of a given timezone
    for example: Asia/Hong_Kong
    my code is like this, but the result is not correct.
    what's wrong?
    import java.util.*;
    public class test {
    public static void main(String[] args){
              String s = "Asia/Hong_Kong";
              String tempS = "";
              TimeZone myTime = new SimpleTimeZone(s);
              //TimeZone myTime = TimeZone.getTimeZone(s);
              Calendar myCal = new GregorianCalendar(myTime);
              tempS = myCal.get(Calendar.YEAR)+"-"+
                        (myCal.get(Calendar.MONTH)+"-"+
                        myCal.get(Calendar.DATE)+" "+
                        (myCal.get(Calendar.HOUR)+":"+
                        myCal.get(Calendar.MINUTE)+":"+
                        myCal.get(Calendar.SECOND);
              System.out.println(tempS);
    output is : 2001-7-15 11:16:48
    but the correct time should be: 2001-8-16 7:17:48
    the correct time should be 2001-8-16

    Certain indexes in the Calendar API start at 0 rather then 1, so, when you get the value, you may want to increment.
    I'm not sure why the time is incorrect. You may want to call getAvailableIDs() and make sure that the desired TimeZone ID is supported by your version. I doubt that Sun would have incorrect support for the time zone, but it may not be included, or perhaps it is included with a diffrent ID. You can always create your own time zone as well, by passing the String offset to getTimeZone(), the offset being how many hours beyond or before GMT. Hopefully this helps.

Maybe you are looking for