Variable being set to file path

Hi,
I am having trouble getting the file path of the file I want to use in my script. This is what my code is. Basically I move a file to the desktop, but if I want to use it on another computer, I want to specific finding the file by extension only.
set orig_file to any file of folder "Desktop" of home whose name extension is ".plist"
I need the /Users/username/Desktop/file.plist version of the file path.
Any help would be appreciated!
Thanks

Use code such as:
tell application "Finder"
set orig_file to POSIX path of (item 1 of (get every file of folder "Desktop" of home whose name extension is “plist") as alias)
end tell
(117185)

Similar Messages

  • How to set default file path for save

    Hello all,
    I'm currently blocked on the below issue and is hoping to gain your help and insights.
    We have recently upgraded to InDesign CS6. Now when an INDD file created in an older version of INDD is opened in CS6, all the save dialogs would not default to the location of the original INDD file. Though if the same file is opened in the version of InDesign that created it, the save dialog goes to the proper location by default.
    Debugged using our custom plugin as a gate way, and found out that after InDesign CS6 performed the document upgrade/convert, the database for the converted document loses file information. i.e.  IDataBase::GetSysFile() returns nil. I think we can figure out some way to get the original file path. For example, we can intercept "kAfterOpenDocSignalResponderService", and get the original file path of the opened file from IDocumentSignalData. Though I haven't yet able to figure out a safe way to set this file path to the document, so that the save dialogs would by default point at this path.
    Utils<Facade::IWorkgroupFacade>()->InitDocumentAssetManagement(docRef, filePath) seems to do the right thing, but it seems to be quite intruding, and I'm afraid that it is overkilling and will cause bad side effect for the use case I'm looking for.
    So I'm wondering if anyone has any suggestions to achieve this without implementing/overriding the file save dialog.
    Thanks.
    -Jeff

    You should be able to avoid writing your own open-doc trap by using kDocBoss's IOpenedFileInfo to obtain the original file's path. It seems fairly reliable; the only time I've seen it come up empty is for an opened QuarkXPress document.
    I'm afraid I don't know of a sanctioned way to change IDataBase::GetSysFile() without going through the database's SaveAs machinery. Overriding this behavior might only be possible by replacing the regular Save dialog with your own.
    But if InitDocumentAssetManagement() is helping, maybe the workgroup/asset management approach is worth pursuing. Have you tried spying on that call in the debug app? You might be able to isolate and use one of the commands that it's invoking (IAMSPManager::BindAsset() / kSetAssetAttributesCmdBoss?) without all of the side-effects of the higher-level call.

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

  • How to set default file path while downloading alv output

    Hi,
    Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
    Please look below screenshots:
    Kindly help me resolve it.
    Thanks in advance.
    Regards,
    Ashutosh Katara

    This information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
    Regards,
    Raymond

  • How to set the file path dynamically based on sytem, username, and date

    Hi All,
    My requirement is upload the data into one  structure like xyz that is related to t.code MCSZ.
    file will be in  UNIx SERVER .
    PATH IS: /sapif
    file name is xy789 load .txt
    I have  to write code in one user-exit
    how can i set the file path for this.
    shall i put hard code file path?
    because i have to writecode in user-exit.
    plz tell me how to set the file path based ons syetem, username, date
    Thanks in advance
    Ram.A

    Concatenate the field SY-SYSID, SY-UNAME and SY-DATUM for the file path

  • Simple question about environment variables and setting the class path???

    ok I have been trying for a few months now ontrying to set the class path..
    I work with windows vista..
    on the environment variables user variables,
    I have the name of the variable as class
    and the value as C:\Program Files\Java\jdk1.6.0_04\bin;.
    where javac is...
    on the system variables I have
    its name as class
    and the value as C:\Program Files\Java\jdk1.6.0_04\bin;.
    why is this not reading javac

    The PATH environment variable should have as an entry the directory containing your javac executable. The CLASSPATH should have have entries which define your library directories and entries which are your jar file libraries. In the early days, probably the only CLATHPATH entry you will need will be a '.' to indicate the current directory.
    The Java tutorial covers ALL of this.

  • Set the file path of get image method

    I have a program that takes multiple IV curves of some nano-devices and saves each set of the IV curve data into a CSV file. I also have a graph on the main screen that gives me a visual representation of the data after each IV curve is taken.
    My program automatically names each IV curve with a different file path and at the end of the program execution I could have 50-60 IV curves.  What i'm trying to do is have LabVIEW export an image file of the graph on my front panel and save it with the save file path as the CSV file.
    Currently i'm using "Invoke Node -> Export Image" method, which is working fine and doing exactly what I want because i can tell it what file path to save to....however it is just a black and white image.
    There is another method that I found here: http://digital.ni.com/public.nsf/allkb/5AE4ADCBB65​A6D8F86256FBF007A1AC1
    That talks about a "Invoke Node -> Get Image Method" which physically captures the colorful chart on the front panel.  However I cannot figure out a way to tell it the file path to save to.  So when I run my program, after each IV curve, it takes the image from the front panel and then on the next IV curve, it interrupts my program to ask me to overwrite the previous file because it's using the same name.
    Is there a way to tell the Get Image Method to save to a specific file path?

    Hi Puneet_K,
    Thanks for the code....I didn't know you could wire the output of the image data to a write VI.  It makes sense in theory and i thought it would work....but it's not actually writing the PNG. I even tried BMP and JPEG but no results.
    I'm posting an image of my code with the before and after.  The before uses export image and it works, the after uses the get image and it doesn't create the file.
    Attachments:
    before.PNG ‏71 KB
    after.PNG ‏71 KB

  • Set FDF file path

    Greetings,
    I have created a form that checks if fields are complete and if so, attaches a FDF file to an email.
    Here is my code:
    var f1 = this.getField("0_type").value;
    var rFields = new Array(
    ["0_type", "Form Type"],
    ["1_account_number", "Account Number"],
    ["1_name_sale_source", "Your Name and Sales Source Number"],
    ["1_pu_facility", "Pickup Facility"],
    ["1_territory", "Pickup Territory"],
    ["3_billing_name", "Billing Contact Name"],
    ["3_company_name", "Billing Company Name"],
    ["3_phone", "Billing Contact Phone"]);
    if(f1 == "re")
    function FormComplete()
    var bComplete = true;
    var errMsg = "";
    RemoveHighlights(["0_type", "1_account_number", "1_name_sale_source", "1_pu_facility", "1_territory", "3_billing_name", "3_company_name", "3_phone"]);
    for (i = 0; i < rFields.length; i++)
    if
    (this.getField(rFields[i][0]).valueAsString == " ")
    bComplete = false;
    errMsg = errMsg + rFields[i][1] + "\n";
    this.getField(rFields[i][0]).fillColor = color.red;
    if (bComplete != true)
    app.alert("The following field(s) need to be completed for a Reactivation request:\n\n" + errMsg,
    1, 1);
    return bComplete;
    function RemoveHighlights(aFields)
    console.println(aFields.length);
    for (i = 0; i < aFields.length; i++)
    this.getField(aFields[i]).fillColor = color.transparent;
    return;
    if(FormComplete())
    this.submitForm({cURL:"mailto:[email protected]?subject=Reactivation Request for "+this.getField("3_company_name").value+" #"+this.getField("1_account_number").value+"&body=Thank you for completing this form.%0A%0AReactivation requests require management approval. Once approval is granted your request will be processed.%0A%0AThank you,%0ASales Support Team&[email protected]"});
    Here's my problem:
    Users are saving the source file in different locations on their hard drives. And, some times they rename their files for future reference. When the exported FDF file arrives it is looking for that source file in the obscure location and when it doesn't find it, prompts the user to locate the file for it. We then navigate to the correct file and the FDF opens correctly.
    Here's my question:
    Using javascript, can I set a specific file path and file name that the FDF will look for when opened? In other words, if a user saves the file in some obscure place with a weird name (like XYZ), the FDF will always look for ABCD file on the desktop.
    Possible? If so, please kindly post a sample script.
    Thx,
    rob

    Not with the submitForm() method.<br /><br />You could use var myFDF = app.newFDF() then set the /F tag with myFDF.addEmbeddedFile(<path>);<br /><br />The only problem is that newFDF() is a security-restricted method so you cannot use it in document-level JavaScript, only folder-level.  If your workflow requires that you use document-level JavaScript then you will not be able to overwrite the /F tag in the FDF generated by submitForm() using any SDK methods.

  • How to set dynamic file path in LSMW

    I am working on LSMW  object to upload say excel file from my desktop.. if someone runs my lsmw application on their system obviously it fails.. is there way where I can dynamically set the path..I mean whomsoever runs the application it picks the file from their location and execute the program.

    hi,,,
    change your code accordingly
    here i am  inserting data into ztable from excel .
    *& Report  ZBI_UPLOAD_DATA_MAST                                             *
    REPORT  zbi_upload_data_mast                        .
    DATA : it_tab TYPE filetable,
           gd_subrc TYPE i.
    TYPES : BEGIN OF wa_wrkctr,
            fictr TYPE zbi_fictr_mast-fictr,
            prctr TYPE zbi_fictr_mast-prctr,
            type TYPE zbi_fictr_mast-type,
            END OF wa_wrkctr.
    DATA : wa_save TYPE zbi_fictr_mast.
    DATA : gd_scol   TYPE i VALUE '1',
           gd_srow   TYPE i VALUE '1',
           gd_ecol   TYPE i VALUE '256',
           gd_erow   TYPE i VALUE '65536'.
    DATA : it_datatab TYPE STANDARD TABLE OF wa_wrkctr WITH HEADER LINE INITIAL SIZE 0.
          it_phy_data TYPE STANDARD TABLE OF wa_energy WITH HEADER LINE INITIAL SIZE 0.
    *data : w_current_inv_no(5) TYPE n,
          w_pop_up_text LIKE  wfcsr_ui_popup_text.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_file LIKE rlgrap-filename OBLIGATORY
                 DEFAULT 'C:\Physical Stock.xls'  .
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Select File Name'
          default_extension       = '*.xls'
          default_filename        = '*.xls'
          file_filter             = '*.xls'
          initial_directory       = 'c:\'
       MULTISELECTION          =
       WITH_ENCODING           =
        CHANGING
          file_table              = it_tab
          rc                      = gd_subrc.
       USER_ACTION             =
       FILE_ENCODING           =
    EXCEPTIONS
       FILE_OPEN_DIALOG_FAILED = 1
       CNTL_ERROR              = 2
       ERROR_NO_GUI            = 3
       NOT_SUPPORTED_BY_GUI    = 4
       others                  = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        READ TABLE it_tab INTO p_file INDEX 1.
      ENDIF.
    START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM upload_excel_file TABLES   it_datatab
                                 USING   p_file
                                         gd_scol
                                         gd_srow
                                         gd_ecol
                                         gd_erow.
    PERFORM eventtab_build CHANGING lt_eventtab.
    PERFORM display_data.
    *&      Form  UPLOAD_EXCEL_FILE
          text
         -->P_IT_DATATAB  text
         -->P_P_FILE  text
         -->P_GD_SCOL  text
         -->P_GD_SROW  text
         -->P_GD_ECOL  text
         -->P_GD_EROW  text
    FORM upload_excel_file  TABLES   p_it_datatab
                            USING    p_file
                                     p_scol
                                     p_srow
                                     p_ecol
                                     p_erow.
      DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.
    Has the following format:
                Row number   | Colum Number   |   Value
         i.e.     1                 1             Name1
                  2                 1             Joe
      DATA : ld_index TYPE i.
      FIELD-SYMBOLS : <fs>.
    Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = p_scol
          i_begin_row             = p_srow
          i_end_col               = p_ecol
          i_end_row               = p_erow
        TABLES
          intern                  = lt_intern
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'Error Uploading file'.
        EXIT.
      ENDIF.
      IF lt_intern[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT lt_intern BY row col.
        LOOP AT lt_intern.
          MOVE lt_intern-col TO ld_index.
          ASSIGN COMPONENT ld_index OF STRUCTURE it_datatab TO <fs>.
          MOVE lt_intern-value TO <fs>.
          AT END OF row.
            APPEND it_datatab.
            CLEAR it_datatab.
          ENDAT.
        ENDLOOP.
      ENDIF.
      IF it_datatab[] IS NOT INITIAL.
        DELETE FROM zbi_fictr_mast.
        COMMIT WORK.
        LOOP AT it_datatab.
          wa_save-fictr = it_datatab-fictr.
          wa_save-prctr = it_datatab-prctr.
          wa_save-type  = it_datatab-type.
          INSERT INTO zbi_fictr_mast VALUES wa_save.
          IF sy-subrc = 0.
            COMMIT WORK.
            MESSAGE 'Data upload complete' TYPE 'S'.
          ENDIF.
          CLEAR wa_save.
          CLEAR it_datatab.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " UPLOAD_EXCEL_FILE
    i hope this will help .
    Regards
    Deepak

  • New to workshop: how to set source file path

    Hello,
    I am new to workshop. I used to use Jdeveloper where I can set project settings to specify java source root and html source root. that way, my source code does not need to be under the standard directory app/project/src/....
    I am wondering if workshop can do the same thing?
    I tried to use import function, but it only copy the files over to its standard directory.

    Hello,
    I am new to workshop. I used to use Jdeveloper where I can set project settings to specify java source root and html source root. that way, my source code does not need to be under the standard directory app/project/src/....
    I am wondering if workshop can do the same thing?
    I tried to use import function, but it only copy the files over to its standard directory.

  • File permissions not being set to files in shared volumes

    I have recently taken over responsibility a small OS 10.5.6 server and several clients. Workstation users log in via user accounts on the server, which also has several shared storages spaces.
    I have recently reinstalled the OS on several of the workstations. They are up to date (10.5.6) and added the directory server using the "Directory Utility".
    My users are able to login and operate using their accounts on the server. However when a file is created on one of these rebuilt workstations, and placed into a common share, they retain the users permissions instead of assuming the group permissions.
    I hope I have stated my problem clearly, thank you in advance for your assistance.

    Hi cdavec007
    I'm having the exact same problem :-/ I've just setup a dual G5 as a server in standard mode, and I've added user permissions (ACL's) as described in the manual via Server Admin App.
    But still when I transfer e.i. a folder containing a bunch of files from my client-Mac to the server HD, it retains ownership and permissions, instead of taking over the permissions set with the ACL.
    This is truely frustrating :-((( I've read the f**** manual, and I think I've done exactly what it says.
    Can anybody help?
    THX - Pinocchio

  • SSIS - Loop through files from a file path based on the value in the variable

    Experts,
    I have a requirement where I'll be loading multiple files in to a SQL server table and archive the files when loaded. However, the challenge is , the file path should be dynamic based on the value of a variable (say, @ProductName).
    For example: If I am running the package for variable @ProductName="Product", the file path would be "\\....\Src\Product", in that case the ForEachLoop will loop through all the files in that folder, load them to the table and Archive
    the files to the "\\....\Src\Product\Archive" folder.
    Similarly, if the @ProductName="Product_NCP", the foreachloop container should loop through files in the "\\....\Src\Product_NCP" folder, load them to the table and archive them to the ""\\....\Src\Product_NCP\Archive"
    folder.
    Any suggestions? I should be able to run the package manually just by passing the "@Product" value, create Archive folder if it doesn't exist, load the data and archive the files.

    Yes
    1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
    like
    (@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
    similary archive
    (@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Set file path in report scripts

    Hi All,
    Is it possible to set the file path to save the extracted data in report scripts, if so please let me know how to do it.
    We can choose the path when executing the script in script editor but how to set the file path in the script itself.
    Thanks in Advance

    You cannot set in in the report script itself.
    But rather you can set the output file and path where the output should be extracted.
    1. When you manually run from EASS console, you can specify the path and the file name
    2. When you use Maxl to run a report script, you can specify.
    Have a look at the Export Data
    Hope it helps
    Regards
    Amarnath
    ORACLE | Essbase

  • File path to metadata

    Hi,
    Anyone knows if it´s possible to set the file path of an image to it's metadata keyword field using a script in Bridge?
    Thank you!

    maybe with a script, to pickup the path "photos/landscapes/summer/beach/shore.jpg" and put it in the keywords like this "photos;landscapes;summer;beach;shore.jpg"
    There is a dedicated Bridge Scripting forum that might have an answer on this:
    https://forums.adobe.com/community/bridge/bridge_scripting
    But to be honest, you could do a lot of this yourself in a relatively easy way.
    You have to know that you can add keywords to multiple files at once just by selecting them.
    However, your first goal should be to create your own keyword tree. This is a bit of work and needs good planning but is needed for future use and comfort. You can also use parent and child (keywords and sub keywords) and in Bridge prefs select to auto apply parent keywords for more ease of use (see further on).
    You can create your list in Bridge keyword panel by using right mouse click menu and choose keyword or sub keyword. Or use a simple text application, you need to start a new line at the beginning for each main keyword, the next line (use enter) with 1 tab creates a sub keywords, again enter with 2 tabs a sub-sub keyword.
    In your case it would mean to create the main keyword landscape, inhere the sub keyword summer, on this again a sub keyword beach, again shore and you are done for this folder.
    Now all you have to do is to select the folder shore and select all files, click on the last sub keyword shore to select it and with the correct preferences setting per above all parent keywords beach, summer and landscape are auto selected. You only have to wait for the task to be finished completely (the metadata has to be saved to the files) before starting the next task.
    There is no need for jpg as keyword and also not for photo's because all images are photo's and mostly jpeg. otherwise the result of the search could be easily filtered for correct file type.
    You can create as many keywords as you like and also many sub keywords. For instance under landscape you can create a new sub keyword for all seasons, just hold the cursor above the parent word and choose new sub keyword. This can also done for beach, you can make it as large as you wish or want.
    Be sure to back up your keyword list regularly (use the tiny menu icon top right in keyword panel and chose export) save it with a proper name and open it in a text application to view how it looks when you have several sub keywords.
    The benefit of creating first a keyword list is that you can easily select new images with existing keywords instead of creating them again and again.
    And it looks far more difficult then it is in reality, just try it and give it a go.
    When done you can use the Search command and choose a main folder, include subfolders and non indexed files and for criteria use keyword and fill in the keyword you want to search for. Having written all keywords to the files other applications can search for them also.

  • How can I get a file path element in XML to work in AI javascript?

    Hi all - this is my first post. I'm pretty familiar with javascript, but I'm new to the Adobe scripting environment.
    Our client wants Illustrator at startup to load a certain pattern swatch. It works fine when I hard code the pattern file path, but it needs to be user configurable, so I put the file path info in an XML file to be read in at startup. The XML file is read in and the elements are extracted into varibles. When I concatenate the variables to create the file path string and try to open the pattern file, it says file not found.
    Here is my source code:
    var fileObj = new File("aiConfig.xml");
    fileObj.open("r:");
    var xmlString = new XML(fileObj.read());
    var driveLetter = xmlString.fullPathName.driveLetter.text();
    var filePath = xmlString.fullPathName.filePath.text();
    var fileName = xmlString.fullPathName.fileName.text();
    var fullFilePath = driveLetter + filePath + fileName;
    var styled_ai = app.open(new File(fullFilePath));
    app.activeDocument = styled_ai;
    Here is aiConfig.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <aiConfig>
      <fullPathName>
         <driveLetter>C:</driveLetter>
         <filePath>/Program Files/Adobe/Adobe Illustrator CS4/Presets/en_US/Swatches/Patterns/Decorative/</filePath>
         <fileName>Decorative_Modern.ai</fileName>
        </fullPathName>
    </aiConfig>
    Any help would be greatly appreciated - this is driving me a little crazy.
    Thanks,
    Tom

    Hi Tomchag,
    Your script works fine on MAC OS X & illustrator CS4.
    i have change only pathway to aiConfig.xml like this:
    var fileObj = new File("/Volumes/LaCie/aiConfig.xml"); //<- path of my external HDD should be D:/ on windows
    and the contents in aiConfig.xml to :
    <?xml version="1.0" encoding="windows-1252" ?>
    <aiConfig>
      <fullPathName>
         <driveLetter></driveLetter>
         <filePath>/Applications/Adobe Illustrator CS4/Presets.localized/fr_FR/Nuancier/</filePath>
         <fileName>VisiBone2.ai</fileName>
        </fullPathName>
    </aiConfig>
    So.. i notice twice thing:
    1) complete file and path for aiConfig.xml
    2) i didn't use drive letter (but it's specific to windows)
    I hope this post can help you
    Cyao, art.chrome

Maybe you are looking for