Check for libraries with a startup script

Is it possible to check for open libraries with a startup script?  Currently, i'm trying like this:
try{
     app.libraries.item("Marks.indl").name
catch(e){
     app.open(File("/Support/InDesign/Lib/Marks.indl"))
If InDesign is already open, this code works correctly (that is, if the library is open, nothing happens, otherwise it opens the library).  However, if I place this in the startup script folder, it will open a second (third, fourth, etc.) copy of the library, even if the library is already open.
I think this happens because the library files are opened later in the startup sequence then the startup scripts are run.  Is there any way to work around this?
Thanks,
/dan

Is your script supposed to work in ID CS3, or later?
Anyway, InDesign CS4 seems to reopen the libraries before launching startup scripts, so the following code works for me:
// Startup Script
const libName = "Marks.indl",
  libPath = "/Support/InDesign/Lib/";
var libFile = libPath + libName;
if( !app.libraries.itemByName(libName).isValid )
  try {app.open(File(libFile))}
  catch(_){alert("Unable to open the library:\r"+libFile);}
@+
Marc

Similar Messages

  • Windows Update failed to check for updates with error 0x800B0001

    Hi all,
    I have a WSUS installed on a Windows Server 2008 R2 box, I have a new Windows Server 2012 box (joined to domain) that cannot get updates from the WSUS, whenever I try to search for new updates I receive the following error in event viewer:
    Windows Update failed to check for updates with error 0x800B0001
    Note: I cannot see the Win2K12 server in the WSUS console under computers node.

    I couldn't get it to run even after installing the mentioned KB fixes. So I investigated the error myself, and found a "hack" that seems to fix the issue. Wrote up a small piece on it here:
    http://tplive.azurewebsites.net/2013/12/windows-update-error/
    You and about a thousand other people have reported "I had already installed [the update], but installing it AGAIN fixed the problem.", which is almost assuredly a simple indication that the original installation of the update failed, and you simply did
    not recognize that the installation of the update was not successful.
    The fact that the /selfupdate folder was corrupted (read: missing files) pretty much says it all. There's no bug. Your installation of the update simply failed. (Or, the server wasn't healthy to begin with and you got what you got.)
    Bottom line: The only known cause for a client-side 0x800B0001 error code is that the WSUS server has not been
    properly and completely patched.
    Lawrence Garvin, M.S., MCITP:EA, MCDBA, MCSA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2013)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence R Garvin
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • How to check for duplicates - with a twist?

    As I'm importing music from my CD collection, is there a way to automatically check for duplicates - with an unusual twist?
    I already imported about 70 CDs using AAC format.
    I just bought a huge external drive specifically for storing my entire collection of CDs and LPs. Now that I have lots of space, I want to import everything in Apple Lossless format.
    Is there an automatic (or at least painless) way to check for duplicates as I'm importing CDs, and to have the old AAC music files over written by the new Apple Lossless files?

    Hi Clinto,
    Do you see the column headers above in itunes? They say Title, Album, Artist, etc. I don't know if it's the same for MAC but in Windows, Right Click on the column headers and click "Kind". This will display the format each song is in. If your column headers already take up all of your screen, you're gonna have to uncheck one to make room for "kind".
    Oh! and to overwrite existing files, make sure the ID3 tags are filled exactly to the old ones prior to ripping, though you don't need to fill all of them. I think you just fill the Artist, Album Artist, Album, and Title. A window will appear as you start to rip. It will ask if you want to overwrite the existing files, click "Yes". Again, don't know about Mac but it works this way in Windows.
    Message was edited by: fullcream

  • I hv iPhone with ios 6.0.2 My iphone could not able to check for update-it's just showing "checking for updates" with loading sign How can I upgrade to ios 7?  Help pls

    I hv iPhone with ios 6.0.2
    My iphone could not able to check for update…it’s just showing “checking for updates” with loading sign
    How can I upgrade to ios 7?
    Help pls

    I agree- I apologize if I sounded skeptical and attacking. In no way did I mean it to sound that way.
    I completely agree on the software-hardware combo issue- this is why apple killed off 1G and 2G devices- because newer software revisions would never ever run well if at all on such ancient devices. can you imagine running iOS 6 on an iPhone/iPod touch 1G? That would be terrible. Let alone iOS 3 runs terrible on them and now are generally rendered useless due to newer App Store requirements (most require 4.3+ now to allow apple to kill off the older devices). forcing newer software on older hardware (apple, dell, HP,... Anything electronic this definitely applies to) will almost always yield less-than-par results. The other part is apple forcing you to upgrade by means of intentially making things obsolete. all companies do that.
    All of this factual info aside, the issue at hand with the 5 is not a software-hardware combo problem- those are most widely seen with the major revisions. then again, this isn't the first time apple has gotten caught up in battery drain snafus (even iOS 5 was plagued with this as well- and now there are some people desperate to roll back but can't). it basically waters it down to the point where keeping the stock software will always yield the best results even though newer versions provide better features- it all depends on whether or not the person deems the added features are worth a performance hit.
    PS. I'm still at 100%- and I've been using it periodically throughout the day. your combo worked for you, but didn't for me. And may or may not work for others- As the tech world would say, mileage may vary.
    PSS. What model/carrier do you have? Just wondering.

  • Thunderbird 31.4 skips checking first pop account on launch with that account set to check for new messages at startup.

    T-Bird Portable 31.4, originally used on WinXP and now on Win7. There are 4 email accounts it's set to check on startup, but it does not check the first one. I have uncheckmarked and recheckmarked the check-on-startup box in the account settings.
    After the recheck interval I specified it does finally get mail for that account, or if I do a manual check, but if neither of those things happens then no matter how many times I launch T-Bird it never gets mail for that account. The account is set up identical to another account through the same ISP /mail server which does get checked. There are no error messages and I have no trouble using that account otherwise.
    I tried to submit this text box a few minutes ago and received some sort of message that I wasn't authorized to view the page and it wiped out the text I wrote. Hope that doesn't happen again this time because it gets really annoying to try to be detailed and thorough then have your time wasted by your browser (Firefox) losing your post. Thanks.

    Hi Dave. I don't follow your solution.
    1. I know of only one location that affects *checking* for mail, and that is on the *main* "Server Settings" panel, in the "Server Settings" section. That section has an advanced button, but there is nothing under that button about checking new mail.
    2. There is no such thing as Server Settings | Message Storage | Advanced, with checkmark box for "Include this server when getting new mail". However, under Sync and Stoarge there is a checkmark box that reads "Keep messages on this computer..."
    So I am curious, and left wondering, what did you really change?
    Can you attach a screen shot?
    See https://support.mozilla.org/en-US/kb/how-do-i-create-screenshot-my-problem

  • Help with a startup script for monitorix

    How can I deal with a perl script that doesn't acknowledge a query for pidof?
    $ ps aux | grep monitorix
    root 1089 0.0 1.2 16280 6556 ? Ss 09:54 0:00 /usr/bin/monitorix -c /etc/monitorix.conf
    So it's running... but I can't find it with pidof:
    $ pidof /usr/bin/monitorix
    Here is the /etc/rc.d/monitorix I've been using but that doesn't stop the program (since it has no PID).
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    PID=`pidof -o %PPID /usr/bin/monitorix`
    MARGS="-c /etc/monitorix.conf"
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [ -z "$PID" ]; then
    /usr/bin/monitorix $MARGS
    fi
    if [ ! -z "$PID" -o $? -gt 0 ]; then
    stat_fail
    else
    PID=`pidof -o %PPID /usr/bin/monitorix`
    echo $PID > /var/run/monitorix.pid
    add_daemon monitorix
    stat_done
    fi
    stop)
    stat_busy "Stopping Monitorix"
    [ ! -z "$PID" ] && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
    stat_fail
    else
    rm_daemon monitorix
    else
    rm_daemon monitorix
    stat_done
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac

    According to the man page, the -p flag will let you generate a PID file.
    You have a few logical errors in your rc.d script and a syntax error (double else in stop). I've been using a template similar to the below in cleaning up a few of the packages I maintain...
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    pidfile=/run/monitorix.pid
    if [[ -r $pidfile ]]; then
    read -r PID < "$pidfile"
    if [[ ! -d /proc/$PID ]]; then
    # stale pidfile
    unset PID
    rm -f "$pidfile"
    fi
    fi
    args=(-c /etc/monitorix.conf -p "$pidfile")
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [[ -z $PID ]] && /usr/bin/monitorix "${args[@]}"; then
    add_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    stop)
    stat_busy "Stopping Monitorix"
    if [[ $PID ]] && kill $PID &> /dev/null; then
    rm_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    please also fix the PKGBUILD:
    install=('readme.install')
    This is not valid, and pacman 4 will not let you declare install as an array.
    Last edited by falconindy (2011-09-25 15:05:02)

  • Set local password with secure startup script

    Since CPassword has been deprecated by MSFT, I need a secure method to set the password of the local administrator on all workstations. The workaround script that MSFT provided in
    the kb article won't work because I have no control over when a computer is on or off. Hence my desire to use a startup script. I logon script would be fine too, but I suspect that wouldn't work since the
    end users don't have access to set these passwords.
    I can set the password with these commands:
    $objUser = [ADSI]"WinNT://./LocalAdmin"
    $objUser.SetPassword("NewPassword")
    but that exposes the password in the script in plain text, which is worse than the CPassword problem that MSFT "fixed."
    So, how can I do this same thing and use a predetermined password without putting it into a logon/startup script in plain text?
    Thanks in advance!
    Blog /
    Facebook / Twitter

    Ha, that's also what I'm doing right now.  The simplest way to eliminate most of the threats, in my opinion, is:
    1) move the script to a separate file share (since Domain\NetLogon is definitely a main target for hackers), and
    2) set the permissions to allow Domain Computers Read Only.  This will eliminate most of the threats.
    If you're still not comfortable having the password in plain text, use the native PS Encryption (Convertto-SecureString and
    Convertfrom-SecureString) and use your own key.
    Dave Wyatt has a very informative post on this topic:
    http://powershell.org/wp/2014/02/01/revisited-powershell-and-encryption/comment-page-1/
    Remember this is not a 100% hacker proof solution, but should be good enough to keep away the novices.

  • Internal Order Budget Check for PO with reference to PR / RFQ

    Hi All,
    I have a scenario where the budget availability control is not working for PO created with reference to PR or RFQ. While creating the PO if i modify the PO value more than RFQ or PR value then system is looking for budget control.
    If we create a direct PO system is checking for Budget control where the PO value is more than availability budget.
    We have the budget control check with internal order for services and non stock material based on substitution rule created for cost element group and cost center group.
    In tolerance limits budget availability control we have not activated for PR, itu2019s activated from PO.
    Kindly let me know what is the reason for budget availability control is not active where the PO is created with reference to PR or RFQ.
    Thanks & Regards,
    Rama Mohan

    493900 - FAQ: Release Strategy:
    It is not possible to create a purchase order if the referenced purchase requisition is not released. But the system allows you to put the purchase order on hold and then release the purchase requisition.
    On the other hand you can create a purchase order with reference to an unreleased request of quotation.

  • How add Authorization check for user with assigened role for t.code-MIR4

    Hi All,
    Regarding authorization how to check authorizations check for user whith assigned roles for the t.code MIR4  using ABAP.
    In Detail:2)     All users are allowed to go to MIR4(invoice number), But ONLY for users with role: MM_RELEASE_INVOICE can proceed to do the posting.
    suggest me...
    Thanks,
    srii..

    Hi Sri ,
    first u need to find out  in which user rules u are using this object , after that if u want to restrict users then remove create/change values from that object values .
    make use of Tcode SUIM to find out all roles which are using this Object.
    or
    ask ur basis guy to remove authorizations to create/change....
    regards
    Prabhu

  • GPO with a startup script is not working.

    I have a GPO that I have added a ".bat" script to the "Computer Configuration\Windows Settings\scripts\startup/shutdown" section. The batch file is located in the netlogon folder. This script was part of another Old GPO
    that I want to consolidate into this new GPO. So I am taking the exact settings from the old GPO and  applying it to the new GPO.
    The script does not run at startup and when I go into Group Policy Management, highlight the GPO then on the right pane click the settings tab it doesn't display the startup script as being set. It's just not there. If I select edit and go to the
    "Computer Configuration\Windows Settings\scripts\startup/shutdown\startup" section the .bat script is present though.
    Also if I do a gpresult it also shows that it isn't running the script but all other settings in the GPO are being applied.
    This GPO has the User Config. side disabled
    Why isn't the GPO applying the script or even acknowledging that it is present in the settings tab?

    Hi,
    I could not see any report in the above link. I would like to know that did you follow the below path:
    http://technet.microsoft.com/en-us/magazine/dd630947.aspx
    In addition, logon script could only be applied to users. If want to apply to computers, we should use startup script.
    Regards,
    Yan Li
    If you have any feedback on our support, please click
    here
    Cataleya Li
    TechNet Community Support

  • Using "Check for Purchases" with applications

    Hey Guys,
    I have an iPod Touch 16gb. I download an application to the iPod via the on-iPod app store. If I go back to my computer and hit check for purchases, it never downloads the newly purchased app.
    I always have to sync my iPod and then it gets transferred over. My question is what would happen if my iPod was stolen or deleted and I lost the app files on my computer, how would I get them back?
    I thought the whole point of "Check for Purchases" was so that it keeps a record of what you downloaded?

    I thought the whole point of "Check for Purchases" was so that it keeps a record of what you downloaded?
    It's to check for stuff you have purchased but not downloaded

  • Problem with embargo check for orders with textposition

    Hi all!
    Our orders get embargo checked by GTS. Some of the orders do have textpositions (Typ AGTX), that causes errors, because they don't have a material number or plant.
    Where can I customize, that these textpositions should not be embargo checked?
    Thank you for your help.
    kind regards
    Sabine

    Hello Sabine,
    you would have to modify BADis for MM0A and SD0A document transfers saying when transferring document with items having AGTX filled not to be relevant for GTS.
    Materials Management u2192 Purchasing u2192 Basic Functions u2192 Foreign
    Trade/Customs u2192 SAP GRC Global Trade Services- Plug-In u2192
    Business Add-Ins for SAP GRC Global Trade Services u2192 Change and
    Expand Document Data for Transfer
    Sales and Distribution u2192 Foreign Trade/Customs u2192 SAP GRC Global
    Trade Services- Plug-In u2192 Business Add-Ins for SAP GRC Global Trade
    Services u2192 Change and Expand Document Data for Transfer
    Hope it helps,
    Best regards,
    Gabriel.

  • Deliv. Indicator is not checked for PO with 0 qty

    Hi
    I am posting a goods receipt using FM BAPI_GOODSMVT_CREATE for a purchase order with a quantity of 0.
    It is not setting the flag for
    Deliv. Completed indicator(ELIKZ) in that purchase order. and that way the order is still open.
    Do you have any idea what can be the problem ?
    I have checked couple of SAP notes related to that like
    515101
    702839
    775616
    816691
    823365
    1017741
    1058907
    But system is already have those notes implemented
    as it has higher support package.
    Its SAP Retail system
    with
    SAP_APPL release 600 level 0012
    EA-RETAIL release 600 level 0012
    Any help will be appreciated.

    Any Idea????

  • Utility to check for Entities with No Data

    Does such a utility exist? We would like to remove several hundred old entities from our production environment but would like some comfort that they have no data records and they have not been used as ICP's.
    I realise we could use data grids or smartview but thats fairly time consuming.

    Not that I know of.
    If you have not done any journals then you could just extract data for each scenario/year see what is in the file. If you have used journals then I have found adhoc (Smartview) is the only way as you cannot easily extract from <Entity Curr Adj> or any of the other adjustment Value nodes.
    You can check journal integrity by loading the new metadata (with removed entities) into a duplicate test environment. You must extract affected journals before you load the new metadata otherwise you will not be able to work with them again.
    You must also consider whether these entities have been ICP. You must see which other entities have had balances with the entities you want to remove. If you do not do this the related data in the source entity will also be removed. You will ahve to put the amount with another ICP before removing your entity.
    Futhermore you should consider any effect that might be caused if you have used allocations.

  • System.loadLibrary() for libraries with dependencies?

    Hi,
    Given an application that depends upon JNI library "jniLibrary.dll" which in turn depends upon "otherLibrary.dll" when one invokes System.loadLibrary("jniLibrary") two things happen:
    1) Under normal applications, the system will complain it can't find dependent library "otherLibrary" because it isn't in the PATH. You can work around this by invoking System.loadLibrary("otherLibrary") first but I've been told System.loadLibrary() is only meant for JNI libraries and invoking it on any other library is not guaranteed to work.
    2) Under Webstart applications, if you try loading "otherLibrary" first it will fail because of http://bugs.sun.com/view_bug.do?bug_id=6191612
    There doesn't seem to be a "correct" way to fix this problem under all environments. Can someone please explain what the application should be doing in this case to ensure that "jniLibrary" loads correctly? Modifying the PATH is not an option because of the Webstart use-case (besides which, users don't appreciate it).
    Thank you,
    Gili

    2) Under Webstart applications, if you try loading "otherLibrary" first it will fail because of http://bugs.sun.com/view_bug.do?bug_id=6191612
    That is a little weird.
    Far as I know you can't stop the OS from loading dependent libraries. Thus when the OS attempts to load library B, if it explicitly depends on library A then the OS (not java) will attempt to load it.
    Now if the OS can't load it then it will throw a system exception.
    So the only way that bug makes sense is if the jws is parsing the shared library to find dependencies and then checking the process space for them and throwing if they are not there. Seems like a lot of work. When it could just load it. (But maybe it is actually loading them from another source)
    At any rate that isn't what that bug says. It says that if you don't in fact load library A, then it will fail. So load it.I filed that bug so I'll try filling in the holes.
    Problem 1: Webstart uses a custom ClassLoader that only unpacks DLLs from their JAR file on-demand. So if you try loading A the class-loader will extract it from the JAR file into a temporary directory and invoke win32's LoadLibrary on it. Of course it will never find any dependent libraries because they haven't been extracted.
    Problem 2: If you use a manifest file (also packed in the JAR file) you have no way to tell Webstart to unpack it alongside the DLL. Loading the DLL without it will fail.
    If I remember correctly (this is off the top of my mind) you can work around problem #1 by loading the dependent libraries first but this won't work if you have circular dependencies. You can work around problem #2 by embedding the manifest file into the DLL file. I'm fairly sure I tried working around #1 as mentioned but it still broke (maybe another problem beyond circular dependencies that I don't recall).
    This is a lot of cryptic work one needs to do just to get things up and running. We're spending most of our time trying to hack the JVM to do what we want instead of it doing what we mean (the spirit of System.loadLibrary()).

Maybe you are looking for