Get filename of a string including filepath and filename

How can I get a file name from a string that includes the filepath and filename? The path is not always the same. For example, the variable may include a "C:\temp\test.doc" or "C:\files\docfiles\test.doc" and I need to get the file name "test.doc" and save it in another variable. Thanks in advance.

on vPath getFilenameFromPath
oldDelim = the itemDelimiter
itemDelimiter = the last char of the moviePath

iFilename = the last element of vPath

itemDelimiter = oldDelim

return iFilename
end

Put that in a movie script. Then, you can call the function from anywhere, anytime
to retrieve the last part of the path - like this:

set getFilenameFromPath("C:\temp\test.doc")
-"test.doc".

As a bonus, it is cross-platform, so it does not work on a Mac as well
as a PC.

Tags: Director

Similar Questions

  • I did an update yesterday and now my lightroom 6 and elements will not open. I get error messages / error 16 on lightroom and we have tried everything, including the creation of a new Director. Help!

    I did an update yesterday and now my lightroom 6 and elements will not open. I get error messages / error 16 on lightroom and we have tried everything, including the creation of a new Director. Help!

    In Adobe Creative Suite or Adobe Creative Cloud configuration error

  • Tent for 3 days of bridge to work. I was told it could read cache - tired everything including deleting and reloading - still getting the same message. PL; help ease that I am on a deadline. Bob

    Cannot read the bridge cache

    Tent for 3 days of bridge to work. I was told it could read cache - tired everything including deleting and reloading - still getting the same message. Computer restarted several times as well. Please help me I'm on a deadline. Bob

    Let me guess: you're under Windows?

    Have you tried a different cache folder location? Because Windows can limit the bridge to access the folder that you have now.

  • help please all access refused to display any files or folders including word and images in the library

    help please, any access to my files and folders denied including pictures and word documents in the library.

    Hello
    • What were the changes made before the problem occurred?
    • What version of Windows are you using?
    • What is the full error message that you receive?
    • Connect you as an administrator?
    You can check these links:
    Diagnose and repair Windows files and folders problems automatically
     
    How to open a file if I get an access denied message?
    See also:
    Troubleshoot "access denied" when opening files or folders
    Note: This link also means on Windows 7
  • How can I get the 8.3 file name short AND way?

    We use some old DOS programs and need to use the old format back (filename.xxx). When the files are in the long trees, it is very difficult to find the names of files under Windows.

    There was a response published in Google (http://answers.google.com/answers/threadview/id/522710.html) which works very well under XP, but when I use it in Windows 7, I get the long file name.

    Does anyone know how to do this?  The program can be changed?  Here is the program of this flajason-ga posted, but it must be updated for Windows 7 (I only know how to program in Foxpro).  Thank you, Alan

    Topic: Re: how to get the 8.3 file name short AND path?
    From: flajason-ga on May 27, 2005 10:45 PDT
     

    After my last comment, I read your details a little closer.
    The last script I posted was to list out a whole directory in 8.3 format.
    If you are looking for a friendly way of Clipboard to recover the 8.3
    for individual files, that will be more to your liking.

    Same thing as before. Copy the below into Notepad and save it with a .vbs extension.
    Except that this time, you can simply drag and drop a folder or file icon
    on the .vbs file and it displays the short path in an input box.
    where you can copy the value and use anything you want to.

    If you're industrious, you can also save the .vbs file in your
    Folder "send to" (C:\Documents and Settings\ [yourname] \SendTo) to have
    It is available in your context menu with a right click.

    Set fso = CreateObject ("Scripting.FileSystemObject")

    ' Is a file or a folder?
    If fso. FolderExists (WScript.Arguments (0)) then
    "It's a folder
    Set objFolder = fso. GetFolder (WScript.Arguments (0))
    Refund = InputBox ("this is your short path:", "SHORT PATH", objFolder.ShortPath)
    End If

    If fso. FileExists (WScript.Arguments (0)) then
    "It's a file
    Set objFile = fso. GetFile (WScript.Arguments (0))
    Refund = InputBox ("this is your short path:", "SHORT PATH", objFile.ShortPath)
    End If

    Hello

    Read the following article.

    How Windows generates 8.3 names to long file names
    http://support.Microsoft.com/kb/142982

  • When executing "Difficulty It Center Microsoft" I get a message "input string was not in a correct format." What does that mean?

    When executing "Difficulty It Center Microsoft" I get a message "input string was not in a correct format." What does that mean?

    Hello

    The question you have posted is related to Microsoft fix and would be better suited in the Microsoft Support Tools Forums. Please visit the link below to find a community that will provide the support you want. http://social.Microsoft.com/forums/en-HK/fixitcenter/threads

  • I can't get my laptop out of safe mode and Internet explorer__

    I can't get my laptop out of safe mode and in internet explore

    http://www.bleepingcomputer.com/tutorials/tutorial61.html

    Above link has info to enter SM

    Table of contents > Vista

    Alterations of ther reading I've included for you out of SM

    1. Close all running programs and open the windows if you are back on the desktop.
    2. Click on the Start () button.
    3. In the search box of the Start Menu () type msconfig and press enter on your keyboard.
    4. The System Configuration utility will open and you will see a screen similar to the one below.


      Figure 8. Vista System Configuration utility

      Click the Startup tab.

    5. You will now be on the screen start as shown below options.


      Figure 9. Tab of Vista startup in the System Configuration utility

      UNCHECK the box labeled Start secure

    6. Press the apply button and then press the OK button.
    7. Now, you will see a prompt stating that you must restart the computer to apply the change.


      Figure 10. Reboot prompt

      Click the restart button to restart your computer.

    See you soon.

    Mick Murphy - Microsoft partner

  • How can I export to PDF for printing Offset, including colors and grayscale of the photo?

    After reading dozens of forum, I not yet found the answer.

    I made a photo album with full-colur and b & w photos for Offset print. I want to be for the b & w grayscale avoid the hues of colors possible. It seems that InDesign does not support the shades of gray, how images become dark. Even with export without any conversion of color or the destination and/or including profiles of original colors, the images are exported to obscurity as a PDF to grayscale.


    How can I export to PDF for printing Offset, including colors and grayscale of the photo?

    Yes, Photoshop & ID CMYK working spaces are the same

    This can become difficult because 3 programs manage proofing differently.

    Work spaces don't matter, document profiles that handle the preview. So here's the same image in grayscale, placed in the ID on the top and PS on the bottom. I put my info in Photoshop to display the profile of doc in the lower left corner. I can see the profile of my InDesign CMYK Document in my test format (CMYK work is different and is not used). The two profiles are actually the same coated FOGRA39 (Black Ink FOGRA in the case of the PS).

    But the previews do not match because I disabled, so the preview InDesign is Gamma 2.2 or a "screen" media preview overprinting.

    If I turn on overprint preview, I get a match because I'm soft proofing for printing:

  • How can I get a list of locations with address and contact information?

    In Adobe Story more, I have gone through the effort to enter the address and the contact information for all locations. Now, I would like to use this information.

    When I choose the sets and locations, I get only names, separated by the Studio and location. No location, no address.

    When I choose to export the list in XML format, I get an XML file that appear to contain address information. However, there don't seem to be a valid, readable XML file or in Excel or Google Docs.

    There are reports that I can create that include this information? Is there a way useful to export XML and open in Excel/number/Google Docs/Word, etc.?

    I'm about to start looking how the XML code can be formatted correctly, but it isn't really where I wanted to spend my time on this project.

    Thank you.

    Yes. I tried on a version of Windows.

    Could you do the following steps to view this XML file in table form in Safari? Then Safari, you can copy paste it Excel.

    1 export the XML from the history list.

    2 check out the "transformSetListIntoTable.xsl" file in the attached zip file and place it in the same directory where the XML list value.

    3. open the xml list file in a text editor and paste the following in its debut.

    4. save the changes.

    5. open the list xml file defined in Safari

    6. in Safari, select all and paste it inside Excel.

  • VM models automatically get a length of string VM value!

    Hi guys,.

    I use lab Manager 3.0 (3.0.2.56), and I created a few models gold.

    I'm deployment new configurations in my workspace using Option of linked Clone and clone not fully, always my Gold models VM automatically get a length of string VM value!

    No idea why this is happening? I'm worried because I need to consolidate all these models to take back the length of the string VM to 0

    (Ideally models don't get any length of string VM right?)

    Kind regards

    esxvmuser

    The mode of operation is a little more complicated than that. Let's say you start with a template and it has a string length of 0 and is located in the 100 on the data store directory.

    The first time that you deploy a virtual machine using this model configuration, the model will be immediately Branch once in machine 101.

    101 machine is the configuration of the virtual machine that you have created and are a 100 machine delta drive. It has a length of chain 1. The string for this virtual machine looks like 100-> 101. the length of the string of the model is always 0.

    Now let's say you do not publish your model you can make some changes to it. As soon as you do not publish the template, it will create branching in a new machine, machine to 102.

    Machine 102 now is the model and it is the length of string is 1. He now has a record of delta. The original model is still in the 100 directory, but it cannot be touched. If you deploy the model, you deploy machine 102 and 100 machine remains intact. Whatever changes you make to the model has no effect on the configuration of virtual machines that have been already deployed from it. The string for this virtual machine looks like 100-102 >.

    Hope that clarifies things.

  • CFpdf and CFcontent this filepath and name of the file in the browser

    Thanks for all the help over my questions CF....

    I developed a download application for (connected to the secure module) users who download a PDF outside the root, moves and renames the file and then cfpdf protects the file with a password. Part of the download process inserts variables into a SQL database such as category, subcategory, file name, etc. Cffile move puts the file inside the root where I have a security framework. No problem with that.

    I have a page of filled cfm (dynamically) with links to pdf files. These links contains the url handlers, passing the path and name. When a user clicks on a link, it is brought to an index.cfm with infrastructure security and in this page, I cfpdf link to the pdf file (and a password) and cfcontent to load the PDF in the browser. All this works fine, as it should.

    However... Because cfpdf sets the path/name of the source and destination file and it transmits the cfcontent tag - the path and name are shown in the browser as well as naming address bar the same as the address http file download (although with underscores) if the user saves the file. Anyone with any sense can include the name and the actual filepath and go directly to the file in their browser. They would still have to enter a password to view the file, but I'd rather not have this filepath exposed like that.

    Without having to create a copy of the original and rename the file, is there a way to change what is listed in the browser's address and the name of download file? At some point it may be a lot of PDFs downloaded and stored on this site. I prefer not to have 2 copies of every file on the server - the original and a reputation...

    I googled and google and can't find an answer anywhere on this. Thanks to all the world pointing me in the right direction here.

    EI

    Finally, figured this out...

    Given that the file exists on the server, there is no need to use cfpdf and cfcontent to serve the PDF file.

    When the user click on the PDF link, the user is directed to a page that contains the security environment where there is a redirect to the PDF document on the server. I have the PDF password protected. The PDF file opens in the browser and, if, is saved with the name of the file only instead of the full url + file name.

    Learn to work with CF and PDFs by cfdocument and cfpdf these last time has been a bit frustrating fun. (!) I guess it was too much trying to do the above, so I needed a direct link to the file itself.

    Hope it helps someone else...

    EI

  • Convert String performed far and format her

    Hello

    I am new to Adobe and javascript. I have a string value that stores the Date of birth in yyyy-mm-dd format, as a string. I need to convert this Date and then place it on a PDF field in the format mm/dd/yyyy.

    Can anyone help?

    Thank you

    You can convert a string representing a date in a date object using the util.scand JavaScript method and and then format a date to a string object by using the util.printd method. For more information, see:

    http://livedocs.Adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1254.html

    http://livedocs.Adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1251.html

    In your case, the code would be something like:

    sDate var = '2013-01-10;

    Convert string to date

    Kai var = util.scand ("yyyy-mm-dd", sDate);

    Convert date to a new string

    var sDate2 = util.printd ("mm/dd/yyyy", anyway);

    Set a field value

    getField("date2").value = sDate2;

    The exact code you use depends on where you place the script and where you get the original date string, but this should help you get started.

  • My iphone6s display just broked. How to get a free display Exchange if repairs and Service coverage is still Active?

    My iphone screen just broked. How to get a free display Exchange if repairs and Service coverage is still Active?

    I found a few shops bestbuys and apple around me.

    Thank you very much!

    Jerry

    There is no exchange of free display.  You will pay is the AppleCare + fresh incident (if you bought AC +), or the elimination of guaranteed replacement costs / costs of replacing the screen.  Your best bet would be to visit the Apple store with a genius bar appointment.

    Make a Genius Bar reservation (or cancel an existing reservation)

    http://www.Apple.com/retail/Geniusbar/

    Log in using your Apple ID.

  • HOW can I remove my Bookmarks Toolbar Firefox's "Getting Started" link? It wastes space and seems invulnerable to the attempted abductions.

    From the outset, I am on a MacBook Air, running Yosemite & the most recent Firefox Help. If your only interest in my question is for bash Macs, then (yawn) I'm not interested. If your interest is to help sincerely, then you have my interest as well:

    I'm stuck with a "Getting Started" Firefox link as the first 'signet' (left) on my bookmarks bar, I really want to delete: I was in the Apple computers (from the Apple] [e) & online since the mid-80s, so I'm hardly a naif in the digital world or Firefox newbie , so having a "Getting Started" link to life is ridiculous, AND I really need the space to accommodate MY choice! Then...

    I tried all ways recommended to delete unwanted bookmarks - Firefox, BUT when I pull down the "Show all bookmarks" command of bookmarks in the Menu bar, there is NO such thing as the "Getting Started" link, so I can't delete it there. I've even linked by clicking and dragging it out of the toolbar, but it does not (nor made more by dragging to the trash. Then, someone has idea of this insurgent link?

    You can try this?

    1. Open the Bookmarks Manager. In what is the Apple menu icon or the menu bar, click bookmarks > show all bookmarks.
    2. In the search bar search Favorites, type getting started.
    3. Delete the bookmark that opens.
  • How to get back my data for the health and the watch Apps once I've restored my phone?

    How to get back my data for the health and the watch Apps once I've restored my phone?

    From the backup, you're going to be restoration.

    If you back up to iTunes, make sure that it is an encrypted backup.

Maybe you are looking for