Stuck with File Path

I am writing a very simple script that exports an image's cutline for my newsroom, i am getting stuck with the having it write the file to the correct path. When I run script as below it works, writing the file to my documents:
function writeCutline () {
                // Linefeed shizzle
            if ($.os.search(/windows/i) != -1)
                fileLineFeed = "windows";
            else
                fileLineFeed = "macintosh";
    var fileName = app.activeDocument.name
    var MetaInfo = app.activeDocument.info;
    MetaInfo = MetaInfo.caption;
    var fileOut = new File(Folder.myDocuments + '/'+ fileName.substring(0,fileName.length-4)+ '.txt');
    fileOut.linefeed = fileLineFeed;
    fileOut.open("w", "TEXT", "????");
    fileOut.writeln(MetaInfo);
    fileOut.close();
writeCutline();
What I want it to do is:
var fileOut = new File( '/c/cutlines/'+ fileName.substring(0,fileName.length-4)+ '.txt');
but this does not work. What do I have to do different?

Thanks for the help guys. I wasn't actually putting the files on C: it was actually going to a mapped network drive and for some reason last night the server was working incorrectly and that is where my problems where coming from. But that raises my next question, is there anyway to address the path with mapping the drive, so it would be a refence to the server. If i was browsing the path it would be TARHSHARE/PHOTOS/photos/DailyATS/Cutlines. With PHOTOS mapped to drive P the path is P:/Photos/Daily/ATS/Cutlines. So what I want to do is get it work without mapping the drive, so the script will work on all of the photographers accounts without mapping the drive.

Similar Messages

  • Problem with file path in linux

    hi,
    i have problem with file path accessing in linux. my java class is accessing a abc.cvs file and and getting all data. it is working fine in windows xp. but i run this same file in linux it does not access the abc.cvs file and does not get any data.
    my project structure
    Search
    abc.cvs
    search.SearchMain
    i am sccessing this cvs file in this SearchMain class by this way file name = "abc.cvs"
    It is working fine with window but problem with linux.
    when i place this abc.cvs in a folder as "./data/abc.cvs" also working fine with windows but not in linux.
    I am new for linux.
    Please give me solution.
    Thanks in advance
    Ravi

    forgot to tell,
    then you need to export that path
    export $CLASSPATH
    code}                                                                                                                                                                               

  • How To Work With File Path in Forms

    Hi
    I have one button on form i use it to call microsoft word when i finsh work i want to save my word file then open save DIALOG box to save that file
    i want to take that path from save dialog box to text item in my form
    how can i do this ?

    If you are using Forms version 9.x or newer, you can use WebUtil to open Word on the client machine, Save the Word file, then do whatever you'd like with the path where the file was saved. If you are using an older version in client/server mode and not web, you would do something similar ony you would use OLE from within the form to call Word.
    In short, we cannot offer much information because you did not provide enough detail about what you are doing, how you are doing it and which product and platform versions you are using.
    WebUtil is included in Forms 10.1.2, so there is no need to download it. In version 9, you would need to manually download and configure it from here:
    http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm

  • Stuck with intersecting paths and shaped gradients - instructions requested

    Hi guys,
    I'm new to this forum as this is my first post here, but I'm stuck with a problem in Illustrator and haven't been able to find the specific solution in other places on the net so far.
    Please have a look at the following design (can't seem to get the image up on this forum):
    http://www.mediafire.com/?pq7mjm4yx65r5cv
    This design has been first created in GIMP and now I want to redo it in Illustrator. I'm using CS6. I haven't been using Illustrator for very long, and I can't seem to get this part right.
    The areas highlighted in red (the shadows) are the major issue. To be able to get a 'folded' effect, I would like to apply subtle shadows on the visible areas of the lower ribbons, where they intersect with the ones on top, as the sample illustrates.
    I don't know how to achieve this effect. This is what I have tried so far:
    - Simple drop shadows, but of course they run outside of the visible areas of the ribbons.
    - I have also tried rectangular selections with a gradient from black to transparent, but for some reason those look right on the silver part of the design, but turn out brown-ish on the blue part. Besides, this is a lot harder to do on the curved sections you can see in the middle.
    Is there a simple way to do this in Illustrator? I have a gut feeling the solution lies somewhere in the pathfinder tool and/or clipping masks, but I'm not really confident as to how to make those work for me.
    As a secondary issue, I would like to get the same 1px bevel/emboss effect as the sample image shows. I have tried the 3D effect in Illustrator, but I can't get the right result that way. What would be the best way to do this?
    I would really appreciate it if someone could write me some short step-by-step instructions for this.
    Below is the sample file for Illustrator. It only has the main shapes and the general colors applied and nothing else.
    CS6 version: http://www.mediafire.com/?skpgfsmy2hxqi6s
    CS5 version: http://www.mediafire.com/?gxxix6el5wcnaad
    My infinite thanks in advance for any help given.
    ~ ID Graphics.

    Start with your simple drop shadows, and then use a clipping mask. Group your letters, and make a copy of the group. Femove shadows from the copy andhange the copy to a black fill. Apply the mask like this: All the unwanted parts of the shadow will be hidden.

  • File Attachment in a Email.... problem with file path

    Hi experts
    I am trying to implement something similar to any email program.
    A user can send email to a user along with attachments.
    I am encountering the following problems:
    1) in IE, the file path is set correctly, but in mozilla only the file name is set. (how do i get the file path in mozilla??)
    2) if i add the file as part of the body in the email, the destination user should only see only the file name and not the entire file path of the source computer.
    any help would be appreciated
    thanx
    deepak

    File on web forms is attached to the case. Go to the case in the admin and you can retrieve the file.

  • Issues with file path in java.io.File

    I am getting file path in eclipse plugin using org.eclipse.swt.widgets.FileDialog and saving the path in XML files.
    In web.xml , path is stored as below (I can't change backsladh to forwardslash or escape backslash since the value is coming from SWT FileDialog)
    <init-param>
    <param-name>filePath</param-name>
    <param-value>c:\new\demo\next\version.txt</param-value>
    </init-param>
    In my filter , i have below code in init() method but am not able to get File reference due to special characters
    String filePath = filterConfig.getInitParameter("filePath");
    // Tried filePath.replace('\\','/') --> Didnot work since \n is a single character
    File f = new File(path)

    No it does not. You need to escape file paths properly. You can check this with simple code and that the problem i am facing now
         public static void main(String[] args) {
              String path = Messages.getString("filePath"); //in messages.properties put filePath=c:\new\next\verison.txt
              System.out.println(path);
              File f = new File(path);
              System.out.println(f.exists());
         }

  • Problem launching Firefox from Windows with file path that contains space characters in the html file's file name

    We have a software application that programmatically launches the default web browser using the Windows shell execute function ("ShellExecuteA" in the "shell32.dll" library of the Windows API) along with a file path for a saved local html file that is to be displayed. In the case that FireFox is the default browser and the file path for the html file contains any space characters in the html file's file name, Firefox (in this case v7.01) will display an error message "File not Found..." and then will also proceed to open tabs for each of the individual words in the file name, launching as the URL path, each individual word appended to ".com".
    In the following example, the path "C:\KSSecOfState\Forms\Kansas Secretary of State - Filings and Forms.htm" when launched programmatically, resulted in the error message "File not Found...Firefox can't find the file at /C:/KSSecOfState/Forms/Kansas." and opened up browser windows for "http://www.secretary.com/", "http://www.of.com/", "http://www.state.com/", "http://www.and.com/", and attempted to launch "http://forms.htm". If the same file (renamed) is launched using the path string "C:\KSSecOfState\Forms\KansasSecretaryOfState-FilingsAndForms.htm" the file opens up correctly in Firefox. Clearly the presence of spaces in the file name is causing the problem.
    I should also note that either path (with or without space characters) works properly if pasted directly into the Firefox URL path menu bar for a live instance of Firefox. The test path strings I used were:
    C:\KSSecOfState\Forms\KansasSecretaryOfState-FilingsAndForms.htm
    C:\KSSecOfState\Forms\Kansas Secretary of State - Filings and Forms.htm
    Does anyone know anything about this problem or how to work around it (other than the obvious answer of taking the spaces out of the file name which is not possible for this application). It seems the problem is specific to Firefox. IE works properly if launched programmatically with spaces in the file name passed to it. I haven't tested other browsers yet.
    Thanks!

    If starting from ShellExecute works the same as starting from the command line then there are two options:<br>
    Put everything inside double quotes<br>
    '''C:\Program Files\Mozilla Firefox\>'''firefox.exe '''"c:\test\svg test.htm"'''<br>
    Convert to a valid url with file:// protocol and percentage-escaping the space<br>
    '''C:\Program Files\Mozilla Firefox\>'''firefox.exe '''file://c:\test\svg%20test.htm'''<br>

  • Problems with file paths in ApplescriptObjC

    Hi
    I am having a problem with trying to Open/Read/Write/Close text files in ApplescriptObjC. The following piece of script works in Applescript but when I try to incorporate in ASOC via Xcode I get the following error "Can’t make current application into type «class fsrf»"  and I have no idea what that means!
    I've tried using POSIX paths but still doesn't work. As usual, any help gratefully received.
    I am using the Control Record to hold the last reference number used so when I add another row to a spreadsheet it will generate the next unique reference.
    set filePath "Macintosh HD:Users:Ours:Documents:Cats Protection:Control Record.txt"
    set fileReference to open for access (file filePath) with write permission
    set lastNumber to read alias filePath -- read all data
    set nextNumber to (text -1 thru -2) of lastNumber as integer -- extract last number
    set nextNumber to (nextNumber + 1) -- increment number
    set nextNumber to text (2 * -1) thru -1 of ("0" & nextNumber) -- add leading zero
    write nextNumber to fileReference starting at 9 -- update next number
    close access fileReference

    «class fsrf» is a file system reference. Long story, but cocoa changed the preferred way to handle file references (in 10.6, I think) and sometimes applescript trips over the difference.
    try changing the first three lines like so:
    set filePath to "/Users/Ours/Documents/Cats Protection/Control Record.txt"
    set fileReference to open for access filePath with write permission
    set lastNumber to read fileReference -- read all data
    Cocoa is generally happier with posix paths, open for access shouldn't need the file keyword, and reading from the file reference (rather than specifying the file again) is cleaner.

  • Bug with file path autocompletion in a sub folder

    Hi,
    I've just update to Mavericks and re-install Edgecode. And now, it's very strange the autocompletion of a file path in a subfolder is absolute...
    i.e.
    In a a style.css file inside a CSS folder, when I write : background-image : url(../ the autocompletion find something like this "Volume/user/myname/myfolder/img" etc. instead of "../img" and it doesn't list the file inside the folder...
    Anyone have the same problem ?
    Thx

    Thanks for reporting bugs. This has been fixed for the next release of Edge Code CC.
    Randy

  • BUG with File Path Browse Button

    Hi,
    I am using LabVIEW 2011 SP1 running in Windows 7.
    I have a Path Control with the Browse Button visible on a front panel.
    In the browse options, I have selected ‘Allow selection of files in LLBs and packed project libraries’
    For the Selection Modes, I have Files or Folders and Existing selected.
    When this VI is run in the LabVIEW Development System (2011 SP1) the Browse Button works as expected and displays the top level Vis in the Packed Library.
    When this VI is run in the LabVIEW Development System (2011 SP1) the Browse Button works as expected and displays the top level Vis in the Packed Library and returns the full path if the selected VI when the OK button is pressed.
    I have built the Main VI into an executeable and when this is run the browse button doesn’t display the dialog window when selecting the .LVLIBP file to browse into.
    Is this some sort of bug in LabVIEW 2011 SP1?
    If it is a bug, has it been fixed in a later release of LabVIEW?
    I have attached a small example to demonstrate the problem.
    Regards
    Ray Farmer
    Attachments:
    Test package.zip ‏542 KB

    Works in the dev environment.  No dialog at all in an executable.  Test done with LabVIEW 2014, Windows 7.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Print list showing graphics used with file paths

    My company is in the process of remapping the graphics on a shared network and I need to go through and make a list of all grphics used in publications along with their filename/path. Hoping there is some plug-in or feature that I can use to create a report that lists this information vs. looking at the options in the links manager and writing things down by hand. Any suggestions? I see the information in a .ps (postscript file) however it's cluttered with everything else. Can I somehow use the ps file and extract only the directory extenstions and filenames/paths.

    FYI I'm working in Pagemaker 6.5 on Windows XP. I can get a report that lists the graphics if I package for Service Provider - unfortunately it doesn't list where the original graphics were located simply the directory it was saved to for teh service provider.

  • ReplaceAll with file-path

    Hello,
    I get a filename from a textfield the user fills in.
    Then I want to do following:
    String in = "....kdfbkhsdbfkbfe #FILENAME# sdfsdkjfhskjdf...";
    String out = in.replaceAll("#FILENAME#",textField.getText());
    Problem: When user fills in something like E:\dir\temp\file then in out there is E:dirtempfile
    ??

    This is because the replacement string is not treated as a plain string. The replacement string may have references to the matching regular expression by using $number. \ is used to escape the $-sign when you want to use it as such.
    [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html#replaceAll(java.lang.String)]http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html#replaceAll(java.lang.String)
        "abcde".replaceAll("[bd]", "<$0>") = a<b>c<d>e
       "abcde".replaceAll("[bd]", "<\\$0>") = a<$0>c<$0>e
       "abcde".replaceAll("[bd]", "\\\\") = a\c\eSo you need to insert slashes in front of each \ and $. This can be done with    textField.getText().replaceAll("[\\\\$]", "\\\\$0");

  • Trouble with file paths

    Hi,
    I'm trying to read a XML file using:
    XMLDocBuilder.java
    public Document getXML(String filepath) throws SAXException, IOException, ParserConfigurationException
              File myFile = new File(filepath);          
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              dbf.setNamespaceAware(false);
              DocumentBuilder docBuilder = dbf.newDocumentBuilder();
              Document myDoc = docBuilder.parse(myFile);
              return myDoc;
         }If I run it directly from Eclipse/Tomcat, it works fine, but if I try to run it from the browser I get the exception "java.io.FileNotFoundException: C:\Documents and Settings\daugusto\content.xml (The system couldn't find the specified file)". (The file isn't there, it's on D:\MyFiles\myProject\WebContent\content.xml)
    I've tried quite some ways now and still couldn't get this to work.
    How can I get it to work from a browser?

    The class receives the filepath argument from a JSP page, after the user submits a form.
    I'm trying to load the XML Document and return it to the JSP page so I can work with it's elements. Using the <input type="file"> component?
    You don't want to retrieve the file using the java.io library.
    The server normally doesn't have access to the client file system. The only exception is when you are a developer working on your local machine where the server and the client are one and the same. That is not the general case :-).
    Intead use a library like the apache commons file upload to read the binary data of the file uploaded.
    cheers,
    evnafets

  • How to read file from server if I have a logical file path?

    Hi guys,
    I'm having a pretty "on the run" question,
    My program is currently reading a file from server using "open dataset" with file path like this (just example)
    /usr/interface/abc/bcd/testfile.dat
    Now I got a requirement to make it more consistent to read files, instead of reading that physical file name, I should read the files from a specific folder using logical path.
    So I go to T code "FILE" and created a logical path called ZABC_FILE_PATH, unix compatible, with physical path is (for example),
    /usr/interface/<sysid>/<client>/<filename>
    My question is, can I still use open dataset statement to read this? if yes, how do I do that? If no, there should be alternative way, please let me know what you think. Thanks,

    Thanks all, I figured it out.
    ONe thing is that typo double quote
    The other thing is the importing part, I need the full file path.
    CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
      EXPORTING
        CLIENT                           = SY-MANDT
        logical_path                     = 'ZABC_MY_LOGICAL_FILE_PATH'
    *   OPERATING_SYSTEM                 = SY-OPSYS
    *   PARAMETER_1                      = ' '
    *   PARAMETER_2                      = ' '
    *   PARAMETER_3                      = ' '
    *   USE_BUFFER                       = ' '
        file_name                        =  v_1
    *   USE_PRESENTATION_SERVER          = ' '
    *   ELEMINATE_BLANKS                 = 'X'
      IMPORTING
        FILE_NAME_WITH_PATH              = v_what_I_need
    * EXCEPTIONS
    *   PATH_NOT_FOUND                   = 1
    *   MISSING_PARAMETER                = 2
    *   OPERATING_SYSTEM_NOT_FOUND       = 3
    *   FILE_SYSTEM_NOT_FOUND            = 4
    *   OTHERS                           = 5
    I really appreciate your contributions, thanks again!

  • File path problems between mac and PC

    hi
    I'm having some issues with file paths, done a lot of searching online, here and on creative cow and no answers to be found (same question asked a few times though).
    I'm working on projects on a MAC and then collecting files (project only) to a watch folder on a PC for rendering.
    Most of the really big files (.R3D) are located locally on the PC but a few files are on a server.
    I can work on them fine on my Mac but when the project comes across to the PC it can find the files located on one of its drives (the same drive as the project source folder) but loses the filepath to the server and to the other internal drive as well.
    I have to open the project on the PC and repoint to the missing footage and then save which is a real pain in the #@$% and kind of defeats the purpose of the distributed rendering.
    how can I set absolute paths for the PCs from my MAC ????
    cheers../daniel

    Hey, sorry Mylenium, but this statement is not true. I was almost convinced to give up after reading this, but I managed to make a working conversion tool shortly after.
    This is the method in After Effects, I am pretty sure that it can work in the rest of the adobe suite as well.
    All you need to do to get the paths to update to windows format is to:
    1. Select "Save as xml" and save an .aepx.
    2. Open the .aepx in text edit.
    3. Perform a find for "/Volumes" and replace with "//<MountPointOnThePC>" (for example I have the drive as a network drive on the pc so I swap the <MountPointOnThePC> to the name of my mac as that is the path on the pc machine)
    4. Perform another find for "MacPOSIX" and replace with "Win"
    5. Save your file and you will be able to open in on a pc with all the files online.
    Disclaimer, I built this to work on my set up using a mac server and a pc render farm for after effects. Please back up your projects before opening them and editing them.
    Hope this helps anyone else trying to do the same.

Maybe you are looking for

  • Error: 500 INTERNAL SERVER ERROR after deployed the office web server in SharePoint 2013

    Hi everyone, I just installed office web server in one virtual machine which name WAC, and I followed all steps for configure and deployer with SharePoint 2013. It did fine without errors. But When I opened a word or ppt or excel in office viewer mod

  • ITunes 7.6 "invalid signature" installation problems with Windows Vista

    I updated my 160Gb Classic to the latest firmware and then up pops: "The iPod cannot be used because it requires iTunes version 7.6 or later. Go to www.itunes.com to download the latest version of iTunes." Everytime I start to download the lastest ve

  • Canon Capt printer driver doesn't work under OSX Mavericks

    Since I upgraded to 10.9, my Canon i Sensys LBP 5050 doesn't print anymore. Installing the latest Capt driver (3.65) from the Canon website didn't solve the problem. Any thoughts?

  • My links are not working

    1st Q: I am new at this and just starting. However, all my hyperlinks work when I am in iweb but after publishing only half are working and the other half don't when it is live. I go back to double check if it is link wrong but again it works when no

  • Errors installing recovery disk: No wifi

    I used the recovery disk; factory settings reboot.... And this happens. It only connects directly to the Internet; no wifi at all. And it won't do windows updates. Now I get this message. I am not sure what I need to do to fix this. You can see in th