[IDC S5] Run a script - get the extension Folder

Hi All
I'm novice in Extension Builder and may be my questions seems stupid...
I want to run a JSX for ID, located in a sub folder of my extension.
I use the "doscript()" method but I don't know how to refer to my ".jsx"
If I set a File variable what kind of path I have to specify? Absolute or not?
How can i get the folder of my extension?
File.applicationDirectory don't returns my extension folder.
Someone can help me?
thanks
Ivan

There are two issues here.
Firstly, how to obtain the file path to your script, or any item under your extension folder.
File.applicationDirectory doesn't return your extension's directory, because extensions are loaded as sub-applications of a top-level "StageManager" application. And so File.applicationDirectory returns the StageManager directory rather than your extension's.
Instead you can use the following CSXSLibrary API to get the full path to an item in the extension directory:
var url:String = "app://" + CSXSInterface.getInstance().getSystemPath(SystemPath.APPLICATION).data + "myScript.jsx";
Secondly, there are some pitfalls to be aware of when using doScript from ActionScript. See Harbs's excellent cookbook entry http://cookbooks.adobe.com/post_Using_InDesign_doScript_UndoModes_in_ActionScript-18462.ht ml
David.

Similar Messages

  • Running perl scripts off the preinstall script during a pkgadd

    Hello,
    I'm trying to build a custom package (apache2 + mysql + php + other stuff) and get stuck on some stone wall that I can't figure.
    Correct me if I'm wrong in my assumptions, and if able, could you provide a work around ? Here it is :
    - The preinstall script must be in /bin/sh , /bin/bash or any valid shell
    - Must be run by root, 'f course
    Now.. As I'm not that strong on bash/sh scripting, I tried to call a perl script off my preinstall script. Somehow my preinstall script just never call the .pl .
    This leads me to my third assumption :
    - It is impossible, not permissible to run other scripts from the preinstall script.
    Basically the perl script checks for some users in /etc/passwd + /etc/group, checks for some directories, create a custom SMF manifest, etc etc . I pretty much want the .pl script to be run.
    The script itself is well packaged, correctly inserted in the package's pkgmap, and so on.
    Any ideas ?
    Thanks,
    Jeff

    The script itself is well packaged, correctly inserted in the package's pkgmap, and so on.http://docs.sun.com/app/docs/doc/817-0406/ch3enhancepkg-10289?a=view

  • Using the FilenameFilter interface to get the extension of a file

    Hello...
    I am trying to write a java program which is going to parse multiple xml documents and load them into the db. In a directory, there could be files other than xml files. Hence, i want to parse only files which have an .xml extension. I am using the FilenameFilter interface to get the extension of the files in a particular directory. However i am getting confused with the way it shd work...i am attaching herewith the code ...pl help me. I would appreciate if u could send me some sample code.
    /* Author : Jayashree */
    import com.xhive.XhiveDriverFactory;
    import com.xhive.error.XhiveException;
    import com.xhive.core.interfaces.XhiveTransactionIf;
    import com.xhive.dom.interfaces.XhiveDocumentIf;
    import com.xhive.core.interfaces.XhiveDatabaseIf;
    import com.xhive.core.interfaces.XhiveConnectionIf;
    import com.xhive.dom.interfaces.XhiveLibraryIf;
    import org.w3c.dom.Document;
    import java.io.*;
    public class MultiXML
    public static void main(String args[])
    try
    String administratorName = "Administrator";
    String administratorPassword = "secret";
    String DBName = "FirstDB";
    XhiveConnectionIf fConnection = XhiveDriverFactory.getDriver().getConnection();
    System.out.println("Got the connection");
    fConnection.connect(administratorName,administratorPassword,DBName);
    System.out.println("Connected");
    XhiveTransactionIf fTrans = fConnection.createTransaction();
    System.out.println("Transaction");
    fTrans.begin();
    System.out.println("Transaction begun");
    XhiveDatabaseIf fDBase = fTrans.getDatabase();
    String DBName1 = fDBase.getName();
    System.out.println(DBName1);
    XhiveLibraryIf rootLibrary = fDBase.getRoot();
    System.out.println("Got the root");
    File fDir = new File("e:/xhive");
    File[] files = fDir.listFiles(new FileFilter("xml"));
    int i = 0;
    while ((i < files.length))
    Document fDoc = null;
    System.out.println("Document Initialized");
    try
    fDoc = rootLibrary.parseDocument(new File(files[i]+".xml").toURL(), XhiveLibraryIf.PARSER_NO_VALIDATION);
    rootLibrary.appendChild(fDoc);
    System.out.println("Appended");
    catch (Exception e)
    e.printStackTrace();
    i++;
    fTrans.commit();
    System.out.println("Committed");
    fTrans.terminate();
    System.out.println("Terminated");
    fConnection.close();
    System.out.println("Connection Closed");
    catch(Exception e)
    System.out.println(e.getMessage());
    In the above code, I am trying to list all those files which have the filter as .xml. I am unable to understand what code i need to write in the accept method of the FilenameFilter interface which accepts the directory name and the file name. There could be a directory which consists of multiple xml files too..this is where i am finding a problem
    Regards,
    Jayashree

    This sample code uses an inner anonymous FilenameFilter that takes all readable files with a ".xml" extension.
    File[] fileList = dir.listFiles (new FilenameFilter () {
        public boolean accept (File dir, String name) {
            if (!name.trim().endsWith (".xml"))
                return false;
            File f = new File (dir, name);
            if (!f.isFile())
                return false;
            if (!f.canRead())
                return false;
            return true;
    });Please post any question if you don't understand.
    Matthieu

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

  • I have repeatedly downloaded itunes but whe I try to run it I get the message "The registry setting used by the itunes drivers for importing and burning CD's and DVD's are missing.  Please reinstall itunes.  I have done this dozens of times

    I have repeatedly downloaded itunes but whe I try to run it I get the message "The registry setting used by the itunes drivers for importing and burning CD's and DVD's are missing.  Please reinstall itunes.  I have done this dozens of times

    Try removing and then reinstalling all the Apple software using:
    Removing and  Reinstalling iTunes, QuickTime, and other software components for  Windows XP

  • Run a Script after the MA is published to SAP ERP.

    Hello, I'm trying to run a script after the MA is published, in order to automatically change it's status.
    I already have the script done and working, the only problem is that I need to know where to put it (or what type of script it should be) in order to run after the MA  has been published successfully.
    Thanks in advance !
    Oscar Obeso.

    That is also a good solution.
    But what I did to fix it was to make a Script to run on validation.
    Then, on that phase I checked the date of sent to external. If that date was null, it meant that Agreement had never been published.
    Otherwise, it meant i had been published, and so I checked for the status to change it if neccesary.
    Thanks for the answers, they are valid solutions too.
    Oscar Obeso.

  • I am trying to get Menu Editor 1.2.7 to work globally for all users. I have added the .xpi to the extensions folder and it is not being installed auto-magically.

    I would like to have Menu Editor installed for all users. I attempted to put the .xpi file in c:\Program Files (x86)\Mozilla Firefox\extensions with the expectation that the user would be prompted to install.

    You need to rename the XPI file to the (GU)ID of the extension as listed in the file install.rdf or just install the extension in a profile and copy the file or folder from that profile to the extensions folder.

  • How to get the enclosing folder of an Application?

    Ok. re-visiting my Applescript to compare installed apps versus a list of predefined apps... here is my test code so far:
    set appsPath to (path to applications folder)
    tell application "Finder"
      set appList to name of every application file of entire contents of folder appsPath
    end tell
    set theApps to {"iMovie.app", "Microsoft Excel", "Microsoft Excel.app", "Adobe Acrobat 7.0 Professional.app", "Adobe After Effects CS4.app", "ColorEyes Display Pro.app", "Corel Painter X.app", "DiskTracker 2.3.2", "EPSON Scan.app", "Flash 8.app", "Product Ingest.app", "Product Tag.app", "Art Ingest.app", "TextWrangler.app", "Toast Titanium.app", "Suitcase Fusion 2.app", "Suitcase Fusion 3.app", "Fetch.app"}
    repeat with anApp in theApps
      set vers to version of (application anApp)
      -- get parent path of anApp!!!!
      if (parentFolder is equal to "Applications" or parentFolder is equal to "Utilities") then
      set parentFolder to ""
      end if
      display alert anApp & ": Version: " & vers & " " & parentFolder
    end repeat
    The only thing I'm stuck on is how to get the parent folder of anApp. Basically we use several versions of software here that are not easily identifiable by the version attribute. However their enclosing folder has all the versioning info I need (e.g.: MS Excel 04's vers would be 110113, but the enclosing folder is "Microsoft Office 2004", and some departments get Office 2008, Office 2011, etc., so I need a human-friendly way to get the right versions)
    I don't know if the "if" statement to check whether the parent is Applications or Utilities is correct as I haven't gotten that far in testing. I'm only interested in getting the parent of apps that have parent folder that is a sub-folder of Applications or Utilities.
    Basically what I am trying to do here is write a text file containing all departmental apps, homefolder sizes, relevant partition sizes, etc. and spit it out at the tech responsible for migrating a user to a new mac (display alert is just convenient for testing purposes). In the past we've had too many "missed" items in QC like wrong apps installed, or wrong versions, or data not copied over properly, etc. So this way they can run this on the old system beforehand and the new system after, line everything up and check off if it matches. This is just a snippet...
    TIA!
    Andrew

    Hi,
    Andrew Caldwell wrote:
    Is there a way to invoke these without the script opening each one?
    You must use the bundle identifier instead of the name
    Here a example :
    set theApps to {"com.microsoft.excel", "com.adobe.Acrobat.Pro", "com.barebones.textwrangler", "com.roxio.Toast", "com.fetchsoftworks.Fetch"}
    repeat with anApp in theApps
           tell application "Finder" to tell (application file id anApp)
                  set vers to version
                  set parentFolder to name of its container
           end tell
           if parentFolder is in {"Applications", "Utilities"} then set parentFolder to ""
           display alert anApp & ": Version: " & vers & " " & parentFolder
    end repeat

  • Where is the extension folder for Adobe Bridge? (Mac)

    I am trying to install the output module on Adobe Bridge. I am totally new to Creative Suite and photoshop. I can't find any information on bridge extensions at all. Here's the page I found on installing the output module- http://helpx.adobe.com/bridge/kb/install-output-module-bridge-cc.html
    I downloaded it but after that is says to copy it into the extension folder. Where is the extension folder? Is it is Bridge? Is it in Finder? Any information on extensions is much appreciated! What exactly are extensions? What is the difference between the extension folder and extension manager?
    Thank you!

    At first sight I can' see anything wrong about the correct locations you used.
    There was no need to delete all workspaces but that also should do no harm I would think.
    You once pointed at the bridge6.plist file but it is not clear to me what you did with it. Personally I would quit Bridge and delete this plist file manually and then restart with again holding down option and use reset preferences.
    And you did also use the reset to standard workspaces instead of the reset workspace to only reset the selected workspace. I don't know for sure this will make a difference but it is worth a try.
    And while you are in the user library to delete the plist file for Bridge also look in the folder caches in this library.
    User / library/caches/adobe/Bridge CC and inhere find and delete both the plug in and cache folder, then restart Bridge.
    Finally it might be also worth a try to download CS6, it should not be needed to do so but it was one of the earlier solutions that worked. In your ACC menu click on any app that shows blue and this brings you to the CC website. Choose download center and find PS. Click on the icon and this gives you the detailed download page. Inhere you can change CC to CS6.
    Download PS6 it and install it (this also installs the CS6 version of Bridge which was not a separate download in CS6). Then try first start CS6 and start the AOM which is installed by default in this version.
    Then when having used this once quit CS6 and try CC (or even combine with restarting your Mac).
    Hope this helps, because I'm running out of options

  • How I get the community Folder of community using adaptive tag?

    Hi,
    How I will get the community Folder of community using adaptive tag.

    Hi,
    Andrew Caldwell wrote:
    Is there a way to invoke these without the script opening each one?
    You must use the bundle identifier instead of the name
    Here a example :
    set theApps to {"com.microsoft.excel", "com.adobe.Acrobat.Pro", "com.barebones.textwrangler", "com.roxio.Toast", "com.fetchsoftworks.Fetch"}
    repeat with anApp in theApps
           tell application "Finder" to tell (application file id anApp)
                  set vers to version
                  set parentFolder to name of its container
           end tell
           if parentFolder is in {"Applications", "Utilities"} then set parentFolder to ""
           display alert anApp & ": Version: " & vers & " " & parentFolder
    end repeat

  • HT203477 My FCP 10.1 is freezing at  "Restore window layout" I am running on mavericks and the layout folder in not in applications support... What do I do ???

    My FCP 10.1 is freezing at  "Restore window layout" I am running on mavericks and the layout folder in not in library/applications support/ final cut pro... What do I do ???

    Had the same issues. For me, I found unmounting any external drives and relaunching FCPX worked.
    Mavericks seems to have some issues with launching Final Cut, so its best to launch and then plug in any external drives - hope that helps.
    Source - http://support-partners.com/troubleshooting-tips-for-fcpx-on-mavericks/
    M

  • On a macbook I purchased secondhand hard drive got corrupted and I started to get the flashing folder with the question mark, I purchased a new hard drive and snow lion install DVD I installed the hard drive and tried disc but kept getting blinking folder

    On a macbook I purchased secondhand hard drive got corrupted and I started to get the flashing folder with the question mark, I purchased a new hard drive and snow lion install DVD I installed the hard drive and tried disc but kept getting blinking folder

    Welcome to Apple Support Communities. We're users here and do not speak for "Apple Inc."
    Power on the computer and insert the DVD immediately.
    Hold down the 'C' key to boot from the Snow Leopard DVD.
    http://support.apple.com/kb/ht1533
    After selecting the appropriate language, if necessary, select Utilities, and Disk Utility.
    You'll likely need to partition and format the new drive before it's recognized.
    http://manuals.info.apple.com/MANUALS/0/MA161/en_US/MacBook_13inch_HardDrive_DIY .pdf
    (Yes, these instructions ARE 7 years old, but the procedure is the same for installing from DVD media.)

  • How to get the system32 folder path in java?

    how to get the system32 folder path in windows using java code?

    Zstar Electronic Co.Ltd, Wholesaler of fire cards for DS/NDSL/NDSi, Provide R4, R4i, DStt, iEDGE, AK2i,M3,M3i,N5
    www.zstar.hk

  • How do you get the Event folder date to match the media dates in FCPX

    Modifying the clip date/time with the Modify command works fine ... but the Event itself still has the date the event was created, not the date of the media that it contains.
    If tried using Touch on the Event folder but FCPX ignores it.
    Any ideas on how to get the Event folder date to match the media dates (or set to any other date desired) so that Events sorted by date show the actual dates of the media that they contain?
    Thanks
    Jonathan

    Here is the texture I've been manipulating  all afternoon to try and achieve the looks i want.
    and when I put this texture over the top of other images and select Multiply, and adjusted the opacity, this is what i get....
    Now this kinda works?? but it still looks not as good on an asian person.
    Thanks by the way to everyone for all the tips, I really really appriciate it   and more suggestions for improvments are welcome!

  • I'm a Pro Tools user, who just did an "Archive and Install" installation of 10.5.8 over my 10.4.11 on my 2 Ghz G5, now Pro Tools won't launch.  I checked the extensions folder and sure enough, the digidesign extensions were left behind.  Can I revert back

    I'm a Pro Tools user, who just did an "Archive and Install" installation of 10.5.8 over my 10.4.11 on my 2 Ghz G5, now Pro Tools won't launch.  I checked the extensions folder and sure enough, the digidesign extensions were left behind.  Can I revert back to the "Archive" of my 10.4.11 System from the "Previous Systems" folder?  If not, what's the point of creating the "archive"?

    Did you select "Preserve User Settings"?
    Archive and Install installation automatically moves existing system files to a folder named Previous System, then installs Mac OS X again. (See tip 3.) You cannot start up your computer using a Previous System folder, nor can you "re-bless" the Previous System folder. (See tip 1.)
    You can choose to preserve your user and network settings before installing. This option automatically moves existing users, Home directories, and network settings. This also skips the Setup Assistant after installation.
    Note: Because the "Preserve user and network settings" option moves, not copies, existing users, Home directories, and network settings, from the Previous Systems folder to the newly installed System, these items will not exist in the Previous Systems folder after the Archive and Install is complete.
    http://support.apple.com/kb/ht1710
    Read this:
    http://support.apple.com/kb/HT2196
    BTW, it is never recommended to do a major OS change without having a full, bootable backup.

Maybe you are looking for

  • Error in at line-selection event...

    Hello experts, In my report, I am hiding the values of BUKRS, ANLN1 and ANLN2 during my loop. I am using field symbols as my work area for my itab which is it_output. The problem is, when I try to do this in my at line-selection event: at line-select

  • Profit center is not found

    Hi masters, While doing MIRO, we are getting the error message like Profit center c.code/profit.center does not exist . I have cheked in KE53 profit center is created and validity is also 01.01.2011 to 31.12.9999. Although i am getting the error mess

  • How to cancel my ID

    Please, How can I cancel my Apple ID?! Is there any way to do it?! Thanks

  • Unzip .exe files

    Hi, does anybody know if it is possible to unzip windows self-extracting zip files (.exe) fro a jave program, and if yes, how to do this. Thanks, Andr�

  • Do we need to Upgrade existing BI 7.0 to EHP1 for BPC 7.0 NW.

    Can BPC 7.0 NW be installed as App Server with EHP1 and then use our existing BI 7.0 as the database.  Or will our BI system need to be upgraded to EHP1?