Script not doing else portion of if...  else...

Ihave a form with many text fields.  I have a specific action i would like to happen with 3 of these fields.  I am trying to determine if, after entering text in 1 of these fields, 2 text fields have data, and, if they do, add that data to the end of a third text field.
I am using the following script as a On Blur action in the field work_item1:
var itemnumber = this.getField("work_item1").valueAsString;
var itemname = this.getField("work1").valueAsString;
var itemdesc = this.getField("work_description").value;
if ( itemnumber != "" && itemname != "" )
itemdesc = itemdesc + itemnumber + " - " + itemname;
this.getField("work_description").setFocus();
else
this.getField("work1").setFocus();
What happens is that if both fields contain text, focus goes to the work_description field where the text should be appended.  So if the condition is apparently evaluated as true as that portion is partially executing.  It is moving focus to the third field, just not putting a value into the third field.  If the condition is false, the else portion does nto seem to execute as focus does not go to the correct place.
I will be placing the same code in the work1 field, just changing the else focus to the work_item1 field.
I am new to JavaScripting, which may be obvious, and I have noone here who knows it to ask.  So what am I missing here?  I have 2 things not happening:
1)  The work_description field's value is not being set when it should.
2)  The else condition is not running.
Regards.
Karl

OK, I figured this out after putting it away for a little while.  In case anyone is wondering, here is the corrected code.  I had to use the variables for all of the work, and define the variable to the object instead of an object's child.
var itemnumber = this.getField("work_item1");
var itemname = this.getField("work1");
var itemdesc = this.getField("work_description");
if ( itemnumber.valueAsString != "" && itemname.valueAsString != "" )
    itemdesc.value = itemdesc.valueAsString + itemnumber.valueAsString + " - " + itemname.valueAsString;
    itemdesc.setFocus();
else
    itemname.setFocus();

Similar Messages

  • HT4623 I updated my iphone to the new version and now it tells me to connect to itunes  which I did and it's not doing anything else, what do I need to do?

    I updated my iphone to the new version and now it tells me to connect to itunes  which I did and it's not doing anything else, what do I need to do?

    Try to connect in recovery mode, explained in this article:
    iOS: Unable to update or restore

  • Photoshop starts on dev PC, but not anywhere else

    Hello all,
    I am developing a Photoshop plug-in, and it runs ok on my development PC. However, when I try to test the plug-in on other PCs, it does not even appear in the Filter list?!
    To install it, I did the same thing I did on my development PC, i.e. creating a directory in the Plug-in folder, and copy the plugin in there. Works ok in the dev PC, but not anywhere else?! Any idea why that could be the case? Is it possible to make Photoshop generate a log of some kind to get more info on the problem?
    Thanks in advance
    Alex

    Hi Toby Thain
    Could you please show me a hint for a problem from Photoshop Plug-In ?
    How I can create a Photoshop Plug-in by using C Carbon on Macintosh OS?
    You can contact me via mail: [email protected]
    [email protected]
    Thanks for your attention
    ThuongDN

  • Firefox is taking a long time to open. When it does open, I get a pop up box with "Script not running". Bookmarks on my tool bar don't load. Scrolling is unreliable--it will stop in the middle of a page

    What is causing the "script not running"? Why so long to open? Etc.

    Hi Donekes,
    First off I need a little more information to help with troubleshooting.  You say that an error occurs when you "try to re-open the same problem app before the old session completely exits".  Does the error have an error code or dialog display?  It may also be possible to receive an error log.  Here is a knowledge base that explains how to retrieve error logs.
    http://digital.ni.com/public.nsf/websearch/54E361E3FF477EC186256C320068184F?OpenDocument
    If you are able to get that information then please post.  Have a good day.
    Brian K.

  • HT1689 Can i use debit card as a payment method on app store..if not,what else?? in case i don''t have credit card...please help

    Can i use debit card as a payment method on app store..if not,what else?? in case i don''t have credit card...please help

    I don't think that debit cards are still accepted as a valid payment method - they are not listed on this page and there have been a number of posts recently about them being declined. You could try contacting iTunes support but I don't think that you will be able to use it : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page
    If you don't have a credit card then are iTunes gift cards available in your country ? They are not available in all countries and they are country-specific (they can only be used in their country of issue), so you won't be able to use those from another country.

  • Is there a way to sync only my music from my iphone to my ipad and NOT anything else like apps?

    I have an iPhone 3 and a brand new iPad 2. I was wondering if there was a way I can sync my music, but not everything else such as apps. I don't want my apps from my phone on my ipad, only the music. How do I go about this?
    Please&Thankyou!!

    iTunes will only give you the option to copy your iTunes Store purchases directly from an iPod to the computer, you'll find details in this article: Copying iTunes Store purchases from your iPod or iPhone to a computer
    Purchased applications can be downloaded over again, see this article for details: How to redownload purchased applications from the App Store
    For everything else (music from CDs etc.) there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod Touch or iPhone. You'll find that they have varying degrees of functionality and some will transfer data (such as playcounts and ratings), movies, videos, photos, podcasts and games as well.
    A selection of iPod/iPhone to iTunes utilities:
    Senuti Mac Only (iPod Touch & iPhone compatible)
    SharePod Windows Only (iPhone and iPod Touch compatible)
    TuneJack Windows Only (iPhone and iPod Touch compatible)
    iPodRip Mac & Windows (iPhone and iPod Touch compatible)
    Music Rescue Mac & Windows (iPhone and iPod Touch compatible)
    iPod Music Liberator Mac & Windows (iPhone and iPod Touch compatible)
    iGadget Mac & Windows (iPhone and iPod Touch compatible)
    iRepo Mac & Windows (iPhone and iPod Touch compatible)
    iPod Access Mac & Windows (iPhone and iPod Touch compatible)
    TouchCopy Mac & Windows (iPhone and iPod Touch compatible)

  • How to find out which lists are using email enabled feature in my SP 2010? Any script? Anything else?

    Hi there,
    How to find out which lists are email enabled in my SP 2010?
    Any script? Anything else?
    Thank you.

    Hi frob,
    check this script that is stated on this link
    $SPwebApp = Get-SPWebApplication "http://migration.Company.com"
    <# If it is MOSS 2007, You can use:
    $SPWebApp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(http://sharepoint.com)
    To get SPWebApplication Object
    #>
    #create a CSV file
    "E-Mail,List,Site" > "EMail-Enabled.txt" #Write the Headers in to a text file
    foreach ($SPsite in $SPwebApp.Sites) # get the collection of site collections
    foreach($SPweb in $SPsite.AllWebs) # get the collection of sub sites
    foreach ($SPList list in $SPweb.Lists)
    if ( ($splist.CanReceiveEmail) -and ($SPlist.EmailAlias) )
    # WRITE-HOST "E-Mail -" $SPList.EmailAlias "is configured for the list "$SPlist.Title "in "$SPweb.Url
    $SPList.EmailAlias + "," + $SPlist.Title +"," + $SPweb.Url >> EMail-Enabled.txt #append the data
    http://www.sharepointdiary.com/2011/06/find-all-incoming-email-enabled-lists.html
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • Java script not working in JSP.

    Hi everyone
    I've got a problem with a java scipt that's not doing what I want it to do.
    I have a jsp which gets data from a database to display.
    On the jsp there is a "add" button which on click will open another jsp to add a contact, when I add the contact the jsp calls a web servlet which adds the contact to the database.
    After the contact is added the servlet directs the page back to the contacts page, and it must display the newly added contact in the jsp.
    I've configured a script that checks if there is a attribute called "addContact", if it has a value of "added" it must reload the page on load, which in turn will display the newly added contact, it refreshes but it doesn't display the newly added contact, it worked but after awhile it stopped working.
    Beneath is my code for the contact list jsp and the servlet.
    ContactList.jsp
    <?xml version="1.0"?>
    <%@ page import="contacts.Contacts"%>
    <%@ page import="java.util.*"%>
    <jsp:useBean id = "contactsData" scope = "page" class ="contacts.ContactsData"/>
    <html>
         <head>
              <title>Contact List</title>
              <script language=JavaScript>
              <!--
                   function clicked(clickedValue)
                        if(clickedValue == "add")
                             window.location = "AddContact.jsp";
              -->
              </script>
         </head>
              <%
              String refreshSession = (String)session.getAttribute("addContact");
              if(refreshSession != null && refreshSession.equals("added"))
              %>
              <body onload="window.location.reload(true);">
              <%
              session.removeAttribute("addContact");
              else
              %>
              <body>
              <%
              %>
              <h1>Contacts</h1>
              <form>
                   <table cellpadding="5">
                        <%
                             ArrayList contactList = contactsData.getContacts();
                             Iterator contactsIterator = contactList.iterator();
                             Contacts contacts;
                             while(contactsIterator.hasNext())
                                  contacts = (Contacts) contactsIterator.next();
                                  String contactName = contacts.getContactName();
                        %>
                                  <tr>
                                       <td><input type="radio" name="deleteContact" value=<%=contactName%>></td>
                                       <td><a href = "UpdateContact.jsp?paramName=<%=contactName%>"><%=contactName%></a></td>
                                       <td><%=contacts.getCompany()%></td>
                                       <td><%=contacts.getWorkNumber()%></td>
                                       <td><a href = "mailto:<%=contacts.getEmail() %>"><%=contacts.getEmail() %></a>
                                  </tr>
                        <%
                        %>
                   </table>
                        <br>
                        <input type="button" value="Add" onClick="clicked('add')"/>
              </form>
         </body>
    </html>NewContactServlet.java
    package contacts;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import contacts.*;
    public class NewContactServlet extends HttpServlet
         public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              res.setHeader("Expires", "Tues, 01 Jan 1980 00:00:00 GMT"); //no cache allowed
              HttpSession session = req.getSession(true); //get current session
              String contactssession = (String)session.getAttribute("contactsSession");
              if(contactssession.equals("add"))
                   Contacts contacts = new Contacts();
                   ContactsData contactsData = new ContactsData();
                   contacts.setContactName(req.getParameter("contactName"));
                   contacts.setCompany(req.getParameter("companyName"));
                   contacts.setWorkNumber(req.getParameter("workNum"));
                   contacts.setCellNumber(req.getParameter("cellNum"));
                   contacts.setFaxNumber(req.getParameter("faxNum"));
                   contacts.setEmail(req.getParameter("email"));
                   contacts.setCountry(req.getParameter("country"));
                   contactsData.addContact(contacts);
              else if(contactssession.equals("add"))
              session.setAttribute("addContact","added");
              res.sendRedirect("ContactList.jsp");
    }

    Ren2407 wrote:
    Hi stevejluke
    Thanks for the reply.
    ContactsData stores the Contacts into a database, Access to be precise.
    The store of the Contacts works fine and it gets redirected to the ContactsList.jsp page, but I need to click refresh on the browser to see the new
    contact. I've tried to make it load automatically when the browser opens but it wouldn't, it worked before.
    I'm using Apache to host the webpage.I don't see any errors.So lemme get this straight:
    You have the contactsList.jsp which when Add is clicked you go to addContact.jsp in the same window. Then when addContact is submitted it goes to the neContact servlet which adds the contact to the database and then sends a redirect back to the contactsList.jsp.
    When contactsList.jsp is re-shown it doesn't display the new data so you are using javascript to force-refresh the page, which used to work, but doesn't anymore.
    My guess is that your browser or some proxy between your browser and server is caching the page. You have to tell all clients not to cache that page using META tags:
    <?xml version="1.0"?>
    <%@ page import="contacts.Contacts"%>
    <%@ page import="java.util.*"%>
    <jsp:useBean id = "contactsData" scope = "page" class ="contacts.ContactsData"/>
    <html>
         <head>
              <title>Contact List</title>
                    <meta HTTP-EQUIV="expires" CONTENT="0" />
                    <meta HTTP-EQUIV="Pragma" CONTENT="no-cache" />
                    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache" /> You could then get rid of your javascript refresh code altogether.
    p.s. I am a big fan of using JSTL. Try to get rid of all your scriptlets and replace it with JSTL. It would look something like this:
              <h1>Contacts</h1>
              <form>
                   <table cellpadding="5">
                        <c:forEach var="contact" items="${contactsData.contacts}">
                                  <tr>
                                       <td><input type="radio" name="deleteContact" value="${contact.name}"></td>
                                       <td><a href = "UpdateContact.jsp?paramName=${contact.name}">${contact.name}</a></td>
                                       <td>${contact.company}</td>
                                       <td>${contact.workNumber}</td>
                                       <td><a href = "mailto:${contact.email}">${contact.email}</a>
                                  </tr>
                        </c:forEach>
                   </table>
                        <br>
                        <input type="button" value="Add" onClick="clicked('add')"/>
              </form>

  • An XSD Exception occurred. The kind 'Note' does not exist in the CMS. (FWM

    Hi,
    I am trying to get the Know Rights for a report object without any success. Everytime my code hits this method it throws an exception
    An XSD Exception occurred. The kind 'Note' does not exist in the CMS. (FWM 04030) (WBP 42029)
    I am stuck with this problem for past two days and am not able to figure out any solution
    Can anyone please help me in this issue?
    Public Function GetObjectRights(ByVal CUID As String) As RightInfo()
            Try
                Dim m_BiPlatform As BusinessObjects.DSWS.BIPlatform.BIPlatform
                Dim urls() As String = _Session.GetAssociatedServicesURL("BIPlatform")
                m_BiPlatform = BusinessObjects.DSWS.BIPlatform.BIPlatform.GetInstance(_Session, urls(0))
                Dim _RightInfo() As RightInfo = m_BiPlatform.GetKnownRights(CUID)
                Return _RightInfo
            Catch ex As DSWSException
            End Try
        End Function
    Thanks,

    Hmm... I can't think of anything else that could be causing the problem.
    I don't know of any way to exclude the 'note' right since GetKnownRights() returns all known rights (RightInfo) for the type of object passed into the method.
    A suggestion might be to try getting the knownRights using the BOE .NET SDK (not web services) to see if the same error occurs.  There is some simple sample code that you can use as a test in the [BOE .NET SDK developers guide|http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_net_dg_12_en.chm].
    If this fails as well, then I can only assume that there is some problem with your install of Enterprise as I have tried many ways to reproduce the error you are getting, but cannot.

  • Does iDVD work with Maverick? This is the first time I tried to burn a DVD using iDVD after upgrading to Maverick. It seems to get stuck at encoding menu stage and not doing anything.

    I tried to burn a DVD using iDVD after upgrading to Maverick, first time I tried after upgrading to Maverick a few weeks ago. It seems to get stuck at encoding menu stage and not doing anything. Does anyone else have the same problem?

    I did not have a DVD handy to burn but I have just created a small 2 minute video and created a Disk Image and also a VIDEO_TS folder, the encoding worked correctly, so it works with some items.
    You may get a better responce in the iDVD forum.
    https://discussions.apple.com/community/ilife/idvd
    regards

  • Best Buy Appliance Delivery Not Doing What They Said They Would Do. Order Cancelled.

    I recently purchased a refrigerator from bestbuy.com and chose the option to have it delivered on Tuesday the second of December (today). I received an order confirmation e-mail from best buy on the day of purchase (November 28) which stated the following (taken directly from the e-mail):
    The scheduled appointment date of your item(s) below is Tuesday, December 2, 2014
    We'll call you by 9PM the night before your appointment with an estimated arrival time window at the phone number(s) you provided at the time of purchase (with either live or pre-recorded calls).
    Thank you for shopping with us.
    Sincerely,
    Karalyn Sartor
    Vice President Customer Care
    Yesterday, on Monday the 1st of December, I got a knock on the door from the Best Buy delivery team. They had my refrigerator and were here to deliver it. I was not ready for them to deliver the refrigerator at that time, at all, as I was not expecting it. I asked the driver to please deliver it on the scheduled date. The change in scheduling happened without a postive notification.
    I checked afterward and saw that their was en e-mail sent during the evening of November 30 informing me that the refrigerator would be delivered on Monday the 1st. This e-mail was in my spam folder and I did not see it. I did not expect it either as I was under the impression that I would be called by phone prior to delivery (as stated in the original purchase confirmation e-mail). So some mistake/change in scheduling happened. Not a big deal to me.
    Thirty minutes ago I called the 1-888 number mentioned in the e-mail to inquire about what time I could expect my refrigerator to be delivered. I was told it was rescheduled for December 20th, which is not acceptable to me.
    I was told the earliest delivery date that they could honor would be for monday the 8th of December. That is unacceptable to me as well. I was advised I had no other options for delivery other than to receive it on the 8th of December, 6 days after the aggreed upon delivery date.
    In the end I cancelled the order. As a customer I do not like to be treated this way (to be told one thing at first (delivery date and that I would be called by phone), to have that one thing change, and to not be told in a *reasonable* manner that the one thing had changed.
    Best Buy customer service, If you would like to contact me you have my e-mail address. You also have my correct phone number for calling me, which your system verified when it looked up my order by phone. Until then, please consider me an unsatisfied customer that will look very closely at other buying options for all my future appliance and home electronics needs.
    Thank You.
    P.S. - The person I spoke to on the phone to inquire about and cancel my order was very courteous and professional.

    To Whom It May Concern,
    I posted earlier regarding a refrigerator delivery problem. http://forums.bestbuy.com/t5/Delivery-Installation/Best-Buy-Appliance-Delivery-Not-Doing-What-They-S...
    I've since read a few of the other posts and think I see some common issues that many others have been having:
    1. Not calling the customer. We (customers) expect someone will call us the day before a scheduled delivery date to confirm the item is being delivered and approximately what time to expect it. The confirmation e-mail you send even states that this will happen.
    2. Not notifying the customer regarding changes. We (customers) expect someone will notify us if delivery dates are changed. This is especially important if the delivery date has been moved forward, as in my case. My particular problem would have been avoided entirely if someone from Best Buy would have notified me that the refrigerator I ordered would arrive one day ahead of schedule. An e-mail is not a good enough notification when you move the shipping date forward. How do you even know I have read/received it and will be home?
    3. Not working with the customer. I've read a few forum posts where some mistake has happened, and now shipping is delayed by a signifcant amount of time (a week or more). If you (Best Buy) had some better way of working with whoever does your delivery for you, things would be better.
    In my example the original delivery date was for today (Dec 2nd). You decided to deliver a day early on the 1st without making sure I knew you were coming on a differnet day than scheduled. So I wasn't ready. At this point I believe you (Best Buy) should have tried to correct this by rescheduling the delivery so that it happened on the original delivery date, December 2nd. You could have also arranged to deliver it later that same day, I would have been ok with that and had time to make things ready. Instead the delivery got rescheduled for the 20th of December by the system, and your customer service could only move it up to December 8. In a situation like this I think it would be better if you worked more with the customer (pay a driver an hour or two of overtime to get the goods delivered on the day you said you would or delay someone else who placed their order after I placed mine). Instead I was given one and only option, delivery on December 8.
    In the end I took the other option, cancelling my order. You have lost my business on this sale and I now have a lower opinion of Best Buy as a company and a brand than I did before. This could have been avoided if you did any of the above three things.
    Thank you for your time.

  • EEM: SAPGUI scripting not enabled on server

    Hi Gurus,
    I have setup SAPGUI EEM monitoring via SOLMAN 7.1 but after deployment there's an error message "SAPGUI scripting not enabled on server()-214722150:disabledByServer=True". I already checked the backend system, and the paramater of sapgui/user_scripting is set to TRUE.
    Please advise what else do I need to check in order for the SAPGUI scripting to be working in EEM? Is there any additional parameter that I need to change in the backend system?
    Thanks,
    Virgilio

    Hi Virgilio,
    See this link is usefully
    Security for the Use of SAP GUI Scripting - eCATT Security Guide - SAP Library
    Regards,
    Deva

  • Exchange 2010 task scheduled scripts not working if not logged on

    Hi All,
    I have done a script for Exchange 2010 and I would like to create a scheduled task for it.
    I have followed the guidance of Mike Pfeiffer's blog.
    http://www.mikepfeiffer.net/2010/02/creating-scheduled-tasks-for-exchange-2010-powershell-scripts/
    However when I set the task as  “Run whether user is logged on or not”, it only works if the user running the task is the administrator. The task is run with high privileges.
    If I do it with a service account (local admin, exchange org admin) it works only when:
    -You run the script for an interactive session of the user or a runas cmd
    -You set the Task as “Run only when the user is logged on” (and the user is logged on)
    If I run the Task as “Run whether user is logged on or not” and the user is not logged on, I get an error on the connection command "Connect-ExchangeServer -auto" (and the task hangs waiting for an answer). The transcript is as follows:
    Transcript started, output file is C:\scripts\informes\pruebasconexion.Log.txt
             Welcome to the Exchange Management Shell!
    Full list of cmdlets: Get-Command
    Only Exchange cmdlets: Get-ExCommand
    Cmdlets that match a specific string: Help *<string>*
    Get general help: Help
    Get help for a cmdlet: Help <cmdlet name> or <cmdlet name> -?
    Show quick reference guide: QuickRef
    Exchange team blog: Get-ExBlog
    Show full output for a command: <command> | Format-List
    Tip of the day #31:
    Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you are typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:
     Get-Send<tab>
    should complete to Get-SendConnector. You can even use wildcards, such as:
     Get-U*P*<tab>
    Pressing the TAB key when you enter this command cycles through all cmdlets that match the expression, such as the Unified Messaging Mailbox policy cmdlets.
    WARNING: The service  () isn't running. Connecting to remote Powershell requires this service to be running.
    VERBOSE: Connecting to CAS01.XXX.es
     An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas01.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    VERBOSE: Connecting to CAS02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas02.XX..Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    WARNING: The service  () isn't running. Connecting to remote Powershell requires this service to be running.
    VERBOSE: Connecting to MBX02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://mbx02.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    VERBOSE: Connecting to CAS01.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas01.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    VERBOSE: Connecting to CAS02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas02.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    WARNING: The service  () isn't running. Connecting to remote Powershell requires this service to be running.
    VERBOSE: Connecting to MBX02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://mbx02.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    Failed to connect to an Exchange server in the current site.
    Enter the server FQDN where you want to connect.:
    The error message refers to a unkown "() service", but I have no clue of which service can be needed and it is working only when session is opened.
     The command I run is
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'c:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1';c:\scripts\informes\estado_db_dag.ps1"
    UNICAN-SdeI

    I experienced a similar symptom where the scheduled task was getting stuck in the "Running" state. I searched the web for others who have experienced this issue with scheduled tasks, and what I found is that there could be a few reasons why
    this might happen. 
    I resolved my problem by adding -NonInteractive switch before the -command parameter.
    Hope it helps...
    In my case, -NonInteractive does indeed stop the task from getting stuck in a perpetual Running state (until it times out based on the settings in scheduled task), but I was able to deduce why by using Start-Transcript and Stop-Transcript.
    Basically, the connection to Exchange is failing some reason and it sits at a prompt waiting for you to enter a FQDN for an Exchange server (same problem as the OP).  Adding -NonInteractive to the scheduled task does indeed prevent the task from getting
    stuck waiting for someone to enter a FQDN at a prompt that they cannot interact with, the script still does not execute correctly.  Essentially, adding the "-NonInteractive" switch does not fix the underlying problem of the Exchange connection
    failing.
    As far as I am able to tell, this has something do with a WinRM problem.  I'm having the same problem as the OP and am trying to troubleshoot it.  In my case, deleting the user profile for the service account does not fix the problem.

  • How would I create a simple script that does these specific things?

    I am trying to create a script that does these few simple task but I can't seem to compile all the cmdlets together into one. I can pick one task out and have a command for it but I want one script to do it all. Here are the tasks I need it to do.
    store the current location (as in C:\scripts)
    test to see if a folder C:\output exists, if it does not, create it
    prompt the visitor for a folder name (no C:\)
    obtain a directory listing of that folder showing all .ps1 files only
    place the results of this listing in a file named PS1_files_[folder name].txt in the c:\output folder
    repeat this task as part of a loop until an empty string is entered
    restore the present location (for example C:\scripts)

    This is a very good script for a someone new to computers to use as a learning exercise.  You will learn how the computer works an learn how to use scripts to manage the computer.
    This is the excat kind of scritp a teach hands you to do on the first day of class.  THe challenge will help you learn.
    Start here to learn how to write a script:http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    Good luck. Post back with specific questions.  Do not forget to include your script and the complete error message.
    You need to learn basic computer logic and decision making.  The learning materials will step you through that.
    ¯\_(ツ)_/¯

  • Extract Pages- and the Split- not doing what I expect them to

    I have a document created in Illustrator (CS4) which has multiple artboards. I want it split into multiple documents, one art board—> one document with only that artwork. When I use the Extract PAges… and the Split… comands to generate multiple documents, I get the multiple docs (same number of docs created as pages in original doc).
    Only thing is every doc has all the artboards and all the artwork as the original doc. I could understand all the artwork being there but all the artboards also?? What's going on?
    Appreciate any pointers on this.
    Trying to write a JSX to run in AI but struggling so far. Thread for AI solution started here: AS) export single page PDFs from multi-artboards

    I don't expect mind reading but I'l settle for careful reading
    I tried to explain how pages and artboards are qualitatively different objects only to be told they are the same thing and that's all I needed to say.
    I tried to explain that opening the very same file in Illustrator showed a lot more objects than it did in Acrobat. You probably don't remember because you breezed over something that you didn't think you needed to know because you were, at each stage, a step ahead of me (slow down already!).
    From my second post:
    I can't remember if Splitting gave enumerate files or the one file but either way ALL the artwork was in the enumerate files if they got made [.…] I ended up saving as CS3 .ai files which gives a Save artboards to seperate files option and, unlike the artboard range option on Save As PDF, it actually works.
    From my third post
    An artboard is not a page as far as Acrobat and Illustrator apps are concerned. I was trying to highlight the distinctly different way the two apps handle them. I can watch a one page with just one shape document in Acrobat become a 20 artboard, 40+ objects layout in Illustrator. Same document interpreted as one Page in Acrobat and 23 artboards in AI.
    I was on this forum because even a manual Document Menu> Split… command is not doing what I expected with the AI generated 23pp PDF file. I expected the 23 individual 'artboards' and content to each make a separate file.
    Thom Parker wrote:
    I don't remember you mentioning that you re-imported the PDF files into Illustrator.  This is an important detail. You also posted to an Acrobat scripting forum and never said you were not interested in an Acrobat Script.  You also never explained the problem you were seeing.  You were never clear.
    Covered that but note Illustrator doesn't import PDF files. .ai .eps and .pdf are all native files for Illustrator and just open, sometimes with an additional dialogue to choose a page from multiple pages. It imports .dwg, .svg and that sort of thing relying on translator plugins. This is the fourth time I'm saying I should have posted in Acrobat Win or Mac not scripting, apologies I was scripting when I made OP and probably frustrated. You were more clear it's true, clearly ignoring what I was getting at in each post re artboard cf. page objects.
    You see, in a PDF file each page has it's own content stream, i.e., a stream of vector graphics operators.  Graphics can be drawn anywhere in the coordinate space, but the page view is clipped by a crop rectangle.  So graphics can exist in the stream, but never be visible to the user because they are outside the crop.  I get the impression that in Illustrator the Artboards all exist in a single coordinate space? And that the conversion to PDF places this entire coordinate space into a single content stream. Then each page would be a different crop of the same content stream.  If this is the case then I believe there are PDF optimization operations in Acrobat that would fix your problem by removing all content outside the crop. 
    Yeah I've hacked lots of PDF files in AI. They use more than one clipping rect per page from memory. Correct, the artboards are defined in a single co-ord space it would seem — artboards are discretely and independently located on the document canvas and can even overlap each other. Yes those operations might work, I never though of that, I came across an Illustrator based solution early on in this thread. There's no conversion going on in Acrobat though I think, the file stays native PDF from AI to Acrobat and back to AI. As I've noted it's the way Acrobat displays or parses the data that in effect hides all the 'off-page' objects but open the same file in AI and it's all still there. 
    You know, we can't read minds, you actually have to explain what it is you need.
    I didn't know it, but I needed to get a confirmation on the artboardRange property bug in Illustrator CS4 and/or a confirmation that artboards are not treated as page objects, and I ended up having to lecture you on something you may have no interest in, sorry if I've been a pain. This is part of bigger bug elsewhere that I've been trying to get resolved or around on and off for a month. Every turn another bug, it gets confusing and frustrating at times

Maybe you are looking for