How to reference a folder/file outside from project folder

Hi All,
I have two extensions which wants to share some code(files) placed in a folder outside from source directory.
for a simple case see the below example.
created a sample extension HelloWorld whose project structure are as follows
HelloWorld
     ExtensionContents
          lib/CSInterface-4.0.0.js
          jsx/InDesign.jsx
          HelloWorld.jsx
          index.html.
I have another folder say "sharedAssets" it contains two images "Orange.gif and pear.gif" which is at same location where HelloWorld and now folder structure becomes
HelloWorld > ExtensionContents
sharedAssets > Orange.gif
                         pear.gif
I have added linked resource folder see the attached screenshot
I have written following line of codes in index.html
<body onLoad="onLoaded()">
<div id="content">
  <ul>
  <li><img src="Orange.gif" width="42" height="42"/></li>
  <li><img src="shared/pear.gif"/></li>
  </ul>
</div></body>
but when I opened the extension then it failed to load Orange.gif and pear.gif,
Please let me know how I could reference an image placed in a folder outside from project folder.
Regards,
Alam

Hi Alam,
I don't use Eclipse / EB myself so I can be of no help in the way you set an alternate location folder there.
I've looked in the MXI reference but it seems there's no token equivalent to the "parent folder of all extensions" i.e.
/Users/Davide/Library/Application\ Support/Adobe/CEPServiceManager4/extensions
or whatever it will be in the future. This is where Extension Manager puts stuff when the MXI is something like:
<file   source="HTML/com.example.helloworld.zxp"
        destination=""
        file-type="CSXS"
        products="Photoshop,Photoshop32,Photoshop64"
        minVersion="14.0" />
that is, destination is blank, file-type is "CSXS".
I've never tried to put there stuff other than ZXP - you can give it a try.
An alternative escamotage could be to use an external folder, which path token exists both in MXI land *and* in (CSInterface or ExtendScript).
That is, a place Extension Manager installs your shared content; which path can be reached from the panel or the JSX.
As an example $userdatafolder/alam/shared in MXI, and Folder.userData/alam/shared in JSX, or SystemPath.USER_DATA/alam/shared in JS.
There are other product specific tokens (Photoshop Script folder for instance) where you can put things into.
Regards
Davide Barranca
www.davidebarranca.com
www.cs-extensions.com

Similar Messages

  • How to upload all excel files data from one folder into internal table.

    Dear All,
    I have one requirement, It is like I want to upload the frontend file data into my internal table, But here my scenario is;
    If I have one folder ( Called : Temp) in my frontend system, in this folder ( Called : Temp)  I have 100 excel files. In each excel file I have some 1000u2019s of entries. All these data of every file I want to take into my internal table.
    If I have one file I can go for, CALL METHOD cl_gui_frontend_services=>file_open_dialog and then upload method to upload. But I want to take all these excel files from that folder at a time, is there any class or any thing is there..? plz help..
    Thanks...
    Edited by: satishsuri on Jan 11, 2011 9:33 AM

    Hi satishsuri ,
    You will have to use 3 methods together :
    CALL METHOD cl_gui_frontend_services=>directory_browse "Browse the Directory
    CALL METHOD cl_gui_frontend_services=>directory_list_files "Get all the files from the directory
    CALL METHOD cl_gui_frontend_services=>gui_upload "Upload each file in a loop
    Example:
    TYPES: BEGIN OF ty_data,
             line TYPE string,
          END OF ty_data.
    DATA: str_file TYPE string,
          str_dir TYPE string,
          it_file_table TYPE STANDARD TABLE OF file_info,
          wa_file_table TYPE file_info,
          v_count TYPE i,
          it_data TYPE STANDARD TABLE OF ty_data,
          wa_data TYPE ty_data.
    CALL METHOD cl_gui_frontend_services=>directory_browse
      CHANGING
        selected_folder = str_dir.
    CALL METHOD cl_gui_frontend_services=>directory_list_files
      EXPORTING
        directory  = str_dir
      CHANGING
        file_table = it_file_table
        count      = v_count.
    LOOP AT it_file_table INTO wa_file_table.
      CONCATENATE str_dir wa_file_table-filename INTO str_file SEPARATED BY '\'.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = str_file
          filetype = 'ASC'
        CHANGING
          data_tab = it_data.
      LOOP AT it_data INTO wa_data.
        WRITE : / wa_data-line.
      ENDLOOP.
      ULINE.
    ENDLOOP.
    Regards,
    Jovito

  • How do I force a file download from a folder above the root?

    I am new to ColdFusion and need some help. I set up a virtual folder on my website and then mapped in the CF9 admin panel to a "Docs" folder above my root, where I would like to store sensitive documents. CF tags are enabled.
    I know that my mapping is set up correctly, because when I set up a cfm page with the following code, I can successfully download the file:
    <cfheader name="Content-Disposition" value="attachment; filename=Calendar.pdf">
    <cfcontent type="application/pdf file=/Docs/Calendar.pdf">
    But what I need is to create one cfm age that will be able to handle downloads of multiple files types and names from the folder above my root.
    I then found Duke Snyder's solution on an older forum for the "click link and download file" question where he suggests making a "download.cfm" page with the following code:  I did this, and named the file "download.cfm"
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "foo/bar" file = "/Docs/#Url.FileName#">
    Then Duke suggests: "Now I pass the FileName through the Url and it WILL ask if you want to open or download the file. We accomplish this by making up an eronious file type."
    I then set up a password-protected page on the site that lists the titles of a number of documents, with links to the virtual folder, where they can be downloaded.  One of the links, which goes to "Calendar.pdf" I constructed as: "download.cfm?FileName=Calendar.pdf"  When I click on the link, I get the popup box that says "Do you want to open or save this file?  With the name listed as: "download.cfm?Filename=Calendar_pdf"
    When I click "Save", I get the message: "Internet Explorer cannot download download.cfm from www.... Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found. Please try again later.
    I must have constructed the link incorrectly. Any ideas?  Thanks in advance for your help.

    I am trying to force the download of pdf files from a folder above the root.  The file below is named "download.cfm"  I pass the name of the file (Calendar.pdf) in the URL link, as follows: download.cfm?filename=Calender.pdf
    In the ColdFusion admin panel, I mapped a folder in the root "Docs"  to point to a folder with a different name above the root.   I have tried the code below, which was generously supplied by another member of this forum, but it does not seem to recognize the CF mapping. Do I need to use another CF Tag for the mapping to working correctly?
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "application/pdf" file = "/Docs/#Url.FileName#">
    Thanks for your help

  • How to delete a specific file type from a folder

    Hi,
    I have folders with lots of zip or rar files, once I decompress those I want to delete the compressed files specifically. Is there any way I could manage that through Automator?
    Thanks in advance.

    Thanks Niel for the script, unfortunately I am too ignorant about running these on my own, I did save it in my user script library, but I would need instructions to run it. I would be really grateful.
    I did try making up my own workflow using the given actions in Automator, the first action was to 'find specific files in finder' ending with .zip and .rar and then choosing another action which 'moves selected files to trash'. Unfortunately it ended up running only if I specify the path to the specific .zip file, which defeats the purpose. Any suggestions on the proposed workflow? Thanks in advance.

  • File Adapter - how to get the file count from a folder

    Hi All,
    I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
    Thanks,
    JJ

    Hi Sarath,
    Thank you for your reply.
    Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
    When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
    The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
    Thanks,
    JJ

  • How do I move a file directly from the desktop to a folder in OX 10?

    I am new to Mac and the Mountain Lion software.  Having worked exclusively with PC operating systems, I am familiar with how to work with files in Windows, but am having trouble doing similar actions in OX 10.  How do I move a file directly from the desktop to a folder in OX?  Although this answer is likely in a video tutorioal (somewhere), I do not have the time to sit an arbitrarily watch generic OS videos that give a broad brush overview, without answering specific queries.  Any help out there?

    You might fun http://www.apple.com/support/macbasics/ to be of help to get used to doing things the Mac way.
    Allan

  • How to reference a DatabaseHandler servlet class from a jsp file in Tomcat

    Trying to create a database connection in the jsp file in webapps\project folder by referencing the DatabaseHandler class in webapps\project\WEB-INF\classes.
    Here is the code in the jsp to make the connection:
    DatabaseHandler db = new DatabaseHandler() ;
    String sql = "SELECT password FROM cms_users WHERE user =" + userName ;
    java.sql.ResultSet rs = db . selectQuery( sql ) ;
    Here is the DatabaseHandler class:
    import java.sql.*;
    public class DatabaseHandler
         // instance variables - replace the example below with your own
    private Connection connection;
         * Constructor for objects of class DatabaseHandler
         public DatabaseHandler()
    String url = "jdbc:odbc:javadatabase";
    // Load the driver to allow connection to the database
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    connection = DriverManager.getConnection( url );
    catch ( ClassNotFoundException cnfex )
    System.err.println( "Failed to load JDBC/ODBC driver." );
    cnfex.printStackTrace();
    System.exit( 1 ); // terminate program
    catch ( SQLException sqlex )
    System.err.println( "Unable to connect" );
    sqlex.printStackTrace();
    public ResultSet selectQuery( String query )
    Statement statement;
    ResultSet resultSet = null ;
    try
    statement = connection.createStatement();
    resultSet = statement.executeQuery( query );
    catch ( SQLException sqlex )
    sqlex.printStackTrace();
    System . exit( 1 ) ;
    return resultSet ;
    Here is the error i am getting when i try to run the jsp script:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /ValidateLogon.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\cms\ValidateLogon_jsp.java:47: cannot find symbol
    symbol : class DatabaseHandler
    location: class org.apache.jsp.ValidateLogon_jsp
    DatabaseHandler db = new DatabaseHandler() ;
    ^

    Just like in the class file you need to import any classes that you want to access in the JSP.
    http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • I want to open a domain.site2 file outside the default folder (User/Library/Application Support/iWeb) with iWeb11, but iWeb only opens the domain file in the default folder. If I delete the default domain file, iWeb wants to create a new site. Help please

    I want to open a domain.site2 file outside the default folder (User/Library/Application Support/iWeb) with iWeb11, but iWeb only opens the domain file in the default folder. If I delete the default domain file, iWeb wants to create a new site. Does anyone have the same problem or know how to fix it?

    In Lion the Finder folder is now invisible.  To make it permanetely visible enter the following in the Terminal applicaiton window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    For opening your domain file in Lion for the first time or to switch between multiple domain files  Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an applicaiton.
    Just launch the applicaiton, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    OT

  • How to save a kit in garageband from a folder in my desktop

    how to save a kit in garageband from a folder in my desktop

    in my safari url bar (it's the place where the www. bit are) to the most right it show an icon on this page it's an apple icon if I click down on it and drag it out of safari on to the desktop it's made into a shortcut for the page

  • How to email a .zip file attachment from PC

    Hi,
    Please, let me know how to email a .zip file attachment from Presentation Server.
    Thanks,
    Madhuri.

    Hi,
    try fm SO_DOCUMENT_SEND_API1
    it's well documented (look with SE37)
    and look here:
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    regards Andreas

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to import a *.dmp file (exported from 10g) to 8i database?

    Hi everybody!
    Could anybody tell me how to import a *.dmp file (exported from 10g) to 8i database?
    I have tried but it seemed to be error "wrong version".
    Thanks a lot!

    From 10.1.0 to 8.1.7 => Use the EXPORT 8.1.7 to export the data from the 10.1.0 database and IMPORT 8.1.7 to
    import the data into the 8.1.7 database.
    Metalink note 132904.1 Subject: Compatibility Matrix for Export & Import Between Different Oracle
    Nicolas.

  • How do i recover a file deleted from iCloud on my iPad

    how do i recover a file deleted from iCloud on my iPad? It's a pages document

    check at https://www.icloud.com/ to see if the file is saved there in documents or iCloud drive
    if not check under settings > iCloud > storage > manage storage and see if there is a backup of the iPad from when the document was still saved
    if there is restoring your iPad form that backup may recover it
    Restore your device from an iCloud or iTunes backup - Apple Support
    if there is not then check to see if it is still saved on any other computers or devices to see if it is saved there
    good luck

  • Is there a way I can set iTunes to add files automatically from a folder in my Windows PC?

    Is there a way I can set iTunes to add files automatically from a folder in my Windows PC and ensure that it is synced automatically? For example, if I add or modify a file in that folder it should be added to iTunes automatically. At the same time the original files in the folder should not be re-organized. That is can I just point to a music folder in my hard drive and sit back for iTunes to do the rest?

    Rishitani wrote:
    ..is there a way i can get it to start apart from restoring...
    Nope.
    Restore “...
    http://support.apple.com/kb/HT1414
    If necessary Place the Device into Recovery mode...
    http://support.apple.com/kb/HT1808
    Note on Recovery Mode.
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...
    Once you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup
    http://support.apple.com/kb/ht1766

Maybe you are looking for

  • Safari 6 not working after update to 10.8

    I just upgraded to OS X 10.8, and tried to open Safari, but keep getting the failed to open dialogue.  I don't use plug-ins and haven't really used it for much as chrome is my browser of choice, but I would like for Safari to start up in case I need

  • HT1338 How to update Logic Pro to Logic Pro X ?

    Is it paid?

  • How to run the oracle application cleint using static ip or domain please e

    How to run the oracle application cleint using static ip or domain please explain me. i am not able to run oracle forms in client machine how to run it please explain me Please give me detail regarding that any body please help me. my mail id::::: [e

  • Cant seem to delete OracleXE and reinstall.

    My OracleXE has a lot of problems. Sometimes it couldnt connect to the server, and cannot display the appropriate pages, and today i couldnt even run the home page. i decided to delete the program and re-install. And there is this error message, "the

  • Error message in Soundtrack Pro

    When I try to send a clip from FCP to Soundtrack Pro to clean up the audio I keep getting this complicated error message that is way over my head. This has happened over two different projects. So, it is not the project file that is corrupted. Any cl