Getting file name from a file path

Hello
I have got a String called filePath and it holds: "C:\Documents and Settings\paul\MyDocuments\nihtd.txt".
What I want do is to have another String variable called fileName that will use the 'filePath' variable to return the name on the file (that been "nihtd.txt" for the example given) but it must work with any file path for any file type.
Can anyone help? I have tried various ways but with no success.
Many thanks
Paul

Hmm, I just ran across another distinction between doing this by creating a File object as opposed to doing this by analysing the String: performance.
I always thought that creation of file objects is relatively cheap, since the Filesystem is not actually accessed when you create a new File instance. Apparently that is not true, at least not if you are on Windows and the file is on another server. Something like new File(\\server\share\file.txt) will create network traffic on Windows. So if you only meant to use the File class for parsing text, you might want to think again.
I would be interested to know how the FileSystem class is implemented on different platforms. Do you know where I can read up on that?
Cheers, HJK

Similar Messages

  • Error code -43 - unable to get file path when burning DVD

    I just installed Tiger on my son's iMac 500. Borrowed a Lacie DVD r/w and tried to burn the contents of a user folder to a DVD-R. It burned part of it, but failed with the following error:
    The operation can not be completed because one or more
    required items an not be found. (Error coed -43).
    Could not open the dat fork of "<unable to get file path>" (-43).
    I was able to burn a CD on the drive, but that was for another user directory that fit on a CD-R. The folder I was trying to burn to the DVD was about 1.1 G.
    Thanks,
    Alfredo

    I just installed Tiger on my son's iMac 500. Borrowed a Lacie DVD r/w and tried to burn the contents of a user folder to a DVD-R. It burned part of it, but failed with the following error:
    The operation can not be completed because one or more
    required items an not be found. (Error coed -43).
    Could not open the dat fork of "<unable to get file path>" (-43).
    I was able to burn a CD on the drive, but that was for another user directory that fit on a CD-R. The folder I was trying to burn to the DVD was about 1.1 G.
    Thanks,
    Alfredo

  • FM for getting MONTH name from DATE.

    Hi all ,
    We have a requirement to get Month name from the DATE,e.g IF date is 01/01/2008 we need a FM which can generate month name as 'JANUARY'.
    \[removed by moderator\]
    Thanks and Regards
    Kiran
    Edited by: Jan Stallkamp on Jul 30, 2008 4:26 PM

    Hi,
    Here is the code u required...
    REPORT  ZASHU_MONTH_NAMES_GET.
    data:r_code type sy-subrc.
    data:mnames type standard table of T247 with header line.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
       LANGUAGE                    = SY-LANGU
    IMPORTING
         RETURN_CODE                 = r_code
    TABLES
        month_names                 = mnames.
    EXCEPTIONS
      MONTH_NAMES_NOT_FOUND       = 1
      OTHERS                      = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write:/ mnames.
    Thanks & Regards
    Ashu Singh

  • Getting user name from sopa header

    How should get user name from soap header in my udf...?i searched in sdn,but not get exact solution...

    I din't get this with SRemoteUser
    1. i've enabled " Do Not Use SOAP Envolope"
    2.Enabled ASMA
    3.Variable Transport Binding .
    used the following code as well:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey user = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/SOAP", "SRemoteUser");
    conf.get(user);
    But not value in it.. Correct me if iam wrong..

  • Fix for getting track names from GraceNote.

    Finally found a Windows fix for getting iTunes to get track names from GraceNote (see below). It works!!!
    Fixing iTunes CDDB lookup - more details
    Since Apple’s forums don’t seem to support permalinks, the hint I previously posted about fixing iTunes for Windows’ connection to CDDB isn’t complete. Here’s how to reestablish connection to CDDB if your track lookups start failing:
    Quit iTunes for Windows.
    In Internet Explorer, go to Tools | Internet Options, click on the Connections tab, and click on the LAN Settings button.
    In the dialog that follows, uncheck the checkbox about using a proxy. Hit OK, then OK again.
    Open RegEdit and look for the following key: HKEYLOCALUSER\Software\CDDB\Control\2.0. Delete this key.
    Open iTunes and insert the CD. iTunes should now be able to connect to CDDB again—at least, until it forgets again later...
    If necessary, reenable your proxy settings.
    Microsoft —Tim Jarrett @ 2/12/04; 8:59:45 AM Discuss Comment (0) Cosmos [#]
    Cheers.
    Tom W.
      Other OS  

    Finally found a Windows fix for getting iTunes to get
    track names from GraceNote (see below). It works!!!
    Fixing iTunes CDDB lookup - more details
    Since Apple’s forums don’t seem to support
    permalinks, the hint I previously posted about fixing
    iTunes for Windows’ connection to CDDB isn’t
    complete. Here’s how to reestablish connection to
    CDDB if your track lookups start failing:
    Quit iTunes for Windows.
    In Internet Explorer, go to Tools | Internet Options,
    click on the Connections tab, and click on the LAN
    Settings button.
    In the dialog that follows, uncheck the checkbox
    about using a proxy. Hit OK, then OK again.
    Open RegEdit and look for the following key:
    HKEYLOCALUSER\Software\CDDB\Control\2.0. Delete
    this key.
    Open iTunes and insert the CD. iTunes should now be
    able to connect to CDDB again—at least, until it
    forgets again later...
    If necessary, reenable your proxy settings.
    Microsoft —Tim Jarrett @ 2/12/04; 8:59:45 AM Discuss
    Comment (0) Cosmos [#]
    Cheers.
    Tom W.
      Other OS  
    I followed this exactly and it didn't work!
    When I put in a CD and click on Get CD Track Names the "Accessing Gracenote CDDB" box flashes up and then disappears and nothing happens!
    Any suggestions???
    Thanks,
    Rach

  • Getting column names from cursor

    Hi all
    I have procedure which produces list of applied for jobs web page(using htp. package)
    I got result in cursor, but have to provide dinamic sort, based on colimn pressed
    procedure my_application_list
    (pi_resume_num     in varchar2 default null
    ,pi_sort_col     in varchar2 default null
    ,pi_page_no     in varchar2 default null
    ,pi_action     in varchar2 default null
    ,pi_msg          in varchar2 default null
    is
    CURSOR cur_job IS
         SELECT      jtl.JOB_TITLE
              ,jtl.COMPANY_NAME
              ,a.APPLY_DATE
              ,a.lang
              ,a.job_id
         FROM job_tl jtl, applied_for_job a, gateway gt
         WHERE a.job_seeker_id=app.job_Seeker
         AND a.job_id=jtl.job_id
         AND a.lang=jtl.lang
         AND a.gateway=gt.gateway
         AND jtl.lang=(SELECT substr(MIN(lt.order_list||jtl0.lang),2) lang
                   FROM      job_tl jtl0
                        ,language_tl lt
                   WHERE jtl0.job_id = a.job_id
                   AND jtl0.lang=lt.lang
                   AND lt.gui_lang=app.language)
         ORDER BY pi_sort_col
    rest of code
    The columns displayed in web page are Job_title, Company_name and Applied_date
    This page is displyed well, bu without column nmes at the top. I am trying to get column names from cursor in order to have ORDER BY <pi_sort_col>
    can someone help how i can get those column names:Job_title, Company_name and Applied_date
    User will be able to click on column and sort
    Thank in advance .I appreciate any help

    Hi Francisco
    Here is my code
    CREATE OR REPLACE PACKAGE BODY cc_web_application_list
    IS
    TYPE COL_NAME_LIST IS TABLE OF VARCHAR2(100)
         INDEX BY BINARY_INTEGER;
    TYPE COL_ORDER_LIST IS TABLE OF VARCHAR2(30)
         INDEX BY BINARY_INTEGER;
    col_name_t col_name_list;
    col_order_t col_order_list;
    procedure my_application_list
         (pi_resume_num     in varchar2 default null
         ,pi_sort_col     in varchar2 default null
         ,pi_page_no     in varchar2 default null
         ,pi_action     in varchar2 default null
         ,pi_msg          in varchar2 default null
    is
    l_my_page_no      PLS_INTEGER :=     TO_NUMBER(nvl(pi_page_no,1));
    l_js_name          gam_user.username%TYPE;
    l_js_first_name          gam_user.first_name%TYPE;
    l_cnt                PLS_INTEGER := 0;
    l_scr_lines      PLS_INTEGER := 0;
    l_curline           PLS_INTEGER;
    l_jobs_applied           PLS_INTEGER;
    l_total_rec      PLS_INTEGER;
    l_total_pages      PLS_INTEGER;
    l_pos               PLS_INTEGER;
    l_first               PLS_INTEGER :=0;
    last                PLS_INTEGER :=0;
    l_lines           PLS_INTEGER := 10;
    col_name      VARCHAR2(100) := col_name_t(3) ;
    col_order           VARCHAR2(30) := 'DESC';
    str                VARCHAR2(2000);
    TYPE display_rec IS TABLE OF VARCHAR2(500) INDEX BY BINARY_INTEGER;
    display           display_rec;
    TYPE page_table_type IS TABLE OF PLS_INTEGER INDEX BY BINARY_INTEGER;
    page_number          page_table_type;
    CURSOR cur_job IS
         SELECT      jtl.JOB_TITLE job_title
              ,jtl.COMPANY_NAME company_name
              ,a.APPLY_DATE apply_date
              ,a.lang
              ,a.job_id
         FROM job_tl jtl, applied_for_job a, gateway gt
         WHERE a.job_seeker_id=app.job_Seeker
         AND a.job_id=jtl.job_id
         AND a.lang=jtl.lang
         AND a.gateway=gt.gateway
         ORDER BY a.apply_date;
    This decode is a problem
              decode(col_order,'ASC'
                   ,decode(col_name
                   ,col_name_t(1), jtl.job_title
                   ,col_name_t(2), jtl.company_name
                   ,col_name_t(3), TO_CHAR(a.apply_date, 'YYYYMMDDhh24miss')
                   ,a.apply_date)
                   ) ASC
              ,decode(col_order,'DESC'
                   ,decode(col_name
                   ,col_name_t(1), jtl.job_title
                   ,col_name_t(2), jtl.company_name
                   ,col_name_t(3), TO_CHAR(a.apply_date, 'YYYYMMDDhh24miss')
                   ,a.apply_date)
                   ) DESC
              ,a.apply_date
    TYPE rec_one IS TABLE OF cur_job%ROWTYPE INDEX BY BINARY_INTEGER;
    r               rec_one;
    BEGIN
    BEGIN
    SELECT username,first_name
    INTO l_js_name,l_js_first_name
    FROM gam_user
    WHERE user_id = App.job_seeker;
    EXCEPTION
    WHEN OTHERS THEN NULL;
    END;
    Cc_Pkg_Elements.p_page_top_job_seeker(
    'Personal Job List'
    ,REPLACE(Txt_Proc_My_Joblist.title_job_list
         ,'##first_name##',l_js_first_name),'N' ,TRUE ,'Pxx');
    ----- get numer of records returned by query
    SELECT COUNT(1)
    INTO l_total_rec
    FROM     job_tl jtl,applied_for_job a
         ,gateway gt
    WHERE a.job_id = jtl.job_id
    AND     a.job_seeker_id     = App.job_seeker
    AND     a.gateway     = gt.gateway ;
    ------get number of pages
    l_total_pages:=CEIL (l_total_rec/l_lines);
    l_jobs_applied := 0;
    col_name := pi_sort_col;
    col_order := pi_sort_col;
    --get first positions
    l_first := (nvl(l_my_page_no,1) - 1) * l_lines + 1;
    FOR rec IN cur_job LOOP
         l_cnt := l_cnt + 1;
         EXIT WHEN l_cnt > l_first + l_lines - 1;
         IF l_cnt >= l_first THEN
              l_scr_lines := l_scr_lines + 1;      
              r(l_scr_lines) := rec;          --assign counter from loop to r index
              IF rec.apply_date IS NOT NULL THEN
              l_jobs_applied := l_jobs_applied + 1;
              END IF;
         END IF;
    END LOOP;
    htp.p('<FORM ACTION="'||App.gateway||'8.my_application_list" METHOD="post">');
    htp.p('<table align="center">');
    htp.p('<tr><td>');
    IF r.COUNT = 0 THEN
         Web_Pkg_Elements.doc_msg(Txt_Proc_My_Joblist.no_jobs);
    END IF;
    htp.p('</td></tr>');
    htp.p('</table>');
    --table_heading(col_name ,col_order );
    htp.p('<table align=center>');
    htp.p('<tr align="center"><td>');
    FOR i IN 1..l_total_pages LOOP
         page_number(i) := i;
         IF page_number(i) = l_total_pages THEN
              htp.p('');
    ||'');
              Web_Pkg_Elements.doc_val_small(page_number(i)||'</A>');          
         ELSE
         htp.p('');
    |'||'');
         Web_Pkg_Elements.doc_val_small(page_number(i)||' |'||'</A>');     
         END IF;
    END LOOP;
    htp.p('</td></tr>');
    htp.p('</table>');
    htp.p('<table align=center>');
    FOR l_curline IN 1..l_scr_lines LOOP
         display(1) := NVL(r(l_curline).job_title, '<br>');
         display(2) := NVL(r(l_curline).company_name, '<br>');
         display(3) := NVL(Cc_Pkg_Nls.date2char(r(l_curline).apply_date, App.date_format), '<br>');
         IF MOD(l_curline, 2) = 0 THEN     
              Cc_Pkg_Elements.tr_even;
         ELSE
              Cc_Pkg_Elements.tr_odd;
         END IF;
         htp.p('<td>');
         htp.p('');
         Web_Pkg_Elements.doc_val(display(1)||'');
         htp.p('</td>');
         htp.p('<td>');
         Web_Pkg_Elements.doc_val(display(2));
         htp.p('</td>');
         htp.p('     <td>');
         Web_Pkg_Elements.doc_val(display(3));
         htp.p('     </td>');
    htp.p('</tr>');
    END LOOP;
    htp.p('</TABLE>');
    htp.p('<TABLE width="88%" BORDER="0" CELLPADDING="0" CELLSPACING="0"
                   align="center">');
    htp.p('<tr valign=bottom>');
    htp.p('<TD colspan=2 align=right>');
    IF l_my_page_no > 1 THEN
         htp.p('<P>'||'<IMG SRC="'||App.image||'prev.gif" ALT="'
         ||Txt_Proc_My_Joblist.prev
         ||'"'     ||' HEIGHT=20 BORDER=0 ALIGN=bottom '
         ||'hspace=2>');
    END IF;
    IF l_my_page_no < CEIL (l_total_rec/l_lines) THEN
         htp.p(' <a href="'||
         web_pkg_elements.link$$(App.gateway||'8.my_application_list?'
         ||'pi_sort_col='||Web_Pkg_Elements.replace_in_url(pi_sort_col)
         ||'&pi_msg=&pi_page_no='||TO_CHAR(l_my_page_no + 1)
         ||">'||'<IMG SRC="'||App.image||'next.gif" ALT="'
         ||Txt_Proc_My_Joblist.NEXT
         ||'"' ||' HEIGHT=20 BORDER=0 ALIGN=bottom '
         ||'hspace=2></a>');
    END IF;
    htp.p('</TD>');
    htp.p('</TR>');
    htp.p('     </TABLE>');
    htp.formHidden('pi_sort_col', pi_sort_col);
    htp.formHidden('pi_page_no', pi_page_no);
    htp.p('</FORM>');
    END my_application_list;
    END ; --cc_pkg_application_list

  • Getting Package Name From Class File Without Parsing File

    I am writing an application where I need to get the package name from a class file without parsing the class file itself.
    Basically, what happens is the user chooses a class file from anywhere in the file system. I then want to use reflection to get information about that class. To do that I need the fully qualified class name. I know that the package name is part or all of the path name but I don't know for sure which part it is. I don't want to parse the class file directly for the package name in case the class file spec is changed (that way I won't have to rewrite any code).
    Does Java have any way of getting this information without doing something stupid like gradually stripping off part of the pathname and trying it?

    The ClassLoader way seems to work fine, copy a class file to "A.class" and run this:import java.io.*;
    class ClassLoaderExample {
        public static void main(String[] args) throws Exception {
            class MyClassLoader extends ClassLoader {
                public Class load() throws IOException {
                    File f = new File("A.class");
                    byte[] classData = new byte[(int) f.length()];
                    new RandomAccessFile(f, "r").readFully(classData);
                    Class loaded = defineClass(null, classData, 0, classData.length);
                    resolveClass(loaded);
                    return loaded;
            Class c = new MyClassLoader().load();
            System.out.println(c);
            System.out.println(c.newInstance());
    }

  • How to fetch the Date column(or Month column) from the file name from the specified path in ODI 11g

    Hi ALL,
    Can any one help us regarding How to fecth the Date column(or month column) from the file name specified in the path in a generalized way .
    For example :
    file name is :subscribers (Cost) Sep13.csv is specified in the below path
      E:\Accounting\documents\subscribers (Cost) Sep13.csv
    here I need to fetch the "Sep13" as a Date column in the ODI 11g in the generalized way.
    Can any one help us in this case as early as possible.

    I would suggest using a piece of Jython code for this.  Something like this...
    import os
    import os.path
    filelist  = os.listdir(E:\Accounting\documents\)
    for file in filelist:
    datestr = file[19:-4]
    You'd need to work out what to do with datestr next...  perhaps write it to a table or update an ODI variable with it.
    Hope this is of some help.

  • How do I get file paths when hovering over a file name in Mountain Lion?

    In Snow Leopard I used to be able to hover over any file name and immediately get a file path in a small yellow window. What has happened to this feature in Mountain Lion?

    arthur, thanks for the path bar tip. That is what I needed. Solved the problem.
    I don't know what has happened to the yellow window that would appear if you hovered over any file showing the path of the file. It was simple to see the path with this window that appeared and disappeared if you moved the cursor.

  • Getting component name from property file

    Hi
    I want to get names for components(say button or label) from property file. How I can achiev this.
    second option is that getting names from database.
    I want to know both the things
    Can anybody help me in getting those names in both the ways. If anyone has sample code it will be really helpfull to me. :)
    Raj

    FileInputStream fin=null;
    Properties property=new Properties();
    try{
          fin=new FileInputStream("myfile.dat");
          property.load(fin);
          fin.close();
    }catch(Exception e){}Infact this is the simpliest way to load property from file. You should check if File exists or readable with catch block. I used Exception but you dont. If you are using an Applet it will be a little different.

  • How to get file path in the form \\filer01\dir\index.htm

    Hi,
    after selecting a file using the FileChooser dialog, i would like to convert the file path like "H:\index.htm" into a form like "\\filer01\dir\index.htm".
    On my system, the logical device name H:\ is mapped to a directory on a file server "filer01".
    Is there any possibility to do this conversion?
    Thanks in advance.

    hi,
    i dont think java has a way of figuring out the actual mappings for a drive, you can retrive all drives that are present using the following code
    File [] roots = File.listRoots();
    then you could just iterate through the roots some of which may be mapped (but you cant figure out which is mapped and which is not).
    So i guess the best way to do it is to have a Properties file with key,value mappings. for eg
    h:\\, \\file01\dir\..
    and then read the value from the Properties file, now if you want this for accessing a resource across the network you dont require to get the actual mapping, you can still use the mapped drive as you would use a unmapped drive.
    hope this helpz
    cheerz
    ynkrish

  • CS2/CS3/CS4: Cannot get file path in Unicode of the current document on Windows

    Hi All,
    In my automation plugin I need to have full absolute path of the opened document with any possible non-English letters. Using SDK examples Listener and Getter that come with Photoshop SDK the full absolute path which I obtain is in the default ANSI code page (CP_ACP) and I can convert it to Unicode using MultiByteToWideChar() API. However this works well when I have corresponding to document name language set in the "Control Panel -> Regional and Language Options -> Advanced -> Select a language to match the language version of the non-Unicode programs you want to use." For example if name of the document has Russian letters and chosen language in "Regional and Language Options" is also Russian the described conversion works well. If I change "Regional and Language Options" to English for example, full path returned by Photoshop SDK API (AliasToFullPath in PIUFile.cpp) for the document with Russian letters will contain "????????.psd" symbols.
    So I need to have an ability to get absolute file path in Unicode. Is it possible in Photoshop CS2/CS3/CS4 for Windows? I have searched forum and SDK but could not find info on it.
    Is it possible to have native HANDLE of the opened file to get file info using Windows API?
    Please advice.
    Below given slightly modified code from Photoshop CS3 which I use to get absolute file pat of the opened document.
    Thanks and regards,
    Sergey
    std::string outFilePath;
    int32 theID = 0;
    SPErr error = kSPNoError;
    error = PIUGetInfo(classDocument, keyDocumentID, &theID, NULL);
    if (error == kSPNoError)
    Handle theFileHandle = NULL;
    error = PIUGetInfoByID(theID, classDocument, keyFileReference, &theFileHandle, NULL);
    if (error == kSPNoError)
    int32 length = sPSHandle->GetSize(theFileHandle);
    Boolean oldLock = FALSE;
    Ptr pointer = NULL;
    sPSHandle->SetLock(theFileHandle, true, &pointer, &oldLock);
    if (pointer != NULL)
    outFilePath = (char*)pointer;
    sPSHandle->SetLock(theFileHandle, oldLock, &pointer, &oldLock);

    Hi All,
    Does anybody know, whether it is possible to get Unicode file path of the current document in Photoshop via Photoshop SDK API or without them?
    Thanks,
    Serhiy

  • How to get file path?

    Hi all,
    I have a tcode ysd_gr. When I execute it, it has one select option & I entered the values as *.csv. It gave 6 csv files(only file names) & I want to retreive data from one file.
    So I need to find the file path. The functional consultants told that the files are in Application server (there are more than 5 application servers are used here).
    So I need to know how to find the file path  and in which application server the file is placed.
    Thanks in advance,
    Vijay.

    Go to t-code AL11 and give the path name excluding the file name:
    I mean for example the name is as below:
    D:\usr\sap\IDS\DVEBMGS00\data\test.csv
    here test.csv is the file name.
    So go to AL11 and give upto D:\usr\sap\IDS\DVEBMGS00\data and dauble click on it and search for the file name.
    Hope this will solve your problem.
    Reward if helpful.
    Thank you.

  • Bug when getting file path in non-english Windows Vista

    Hello,
    I'm getting an error when trying to get the file path of a video in a non-english Windows Vista... The code is:
    var file = "video.flv"
    var filePath = air.File.applicationStorageDirectory.resolvePath(file);
    filePath = filePath.nativePath;
    The filePath variable is used later by a flash video player to load the video file..
    In the brazilian Windows Vista the path of the StorageDirectory would be something like "C:\Usuários\(user name)\..." but if I run this script it returns "C:\Users\(user name)\..." as the native path.
    The problem seems to be in the "nativePath" function, cause I'm able to copy files to the app-storage folder using the "air.File.appicationStorageDirectory.resolvePath()" method without any problems.
    I could insert a small code which substitutes "Users" with "Usuários" but then it wouldn't work on an english Vista...
    Any ideas on this? Is there a way to check the language of the operating system in Air so to act accordingly?
    Thanks for any help!

    Hello,
    has anybody found a solution?
    Testcase: SQL Developer 3.1 on a German XP with default NLS Settings
    CREATE TABLE "TEST_TABLE"
           "NUM" NUMBER
          ,"VCH"  VARCHAR2(10 BYTE)
        ) ;Test file test_insert.dsv
    num;vch
    1;KL
    1,5;tz
    12345,45;ooImporting using the wizard inserts the first row correctly, for the others I get
    SET DEFINE OFF
    --Einfügen für Zeilen  1  bis  3  nicht erfolgreich
    --ORA-01722: invalid number
    --Zeile 2
    INSERT INTO TEST_TABLE (NUM, VCH) VALUES (1.5,'tz');
    --Zeile 3
    INSERT INTO TEST_TABLE (NUM, VCH) VALUES (12345.45,'oo');Beside the wrong umlaut in the message the insert statement itself is correct, because you cannot use the german decimal separator "," in the script. The bug is, that it should use the same NLS settings for generating and running the script.
    Regards
    Marcus

  • Getting File Path to Open

    Is there a way to copy a full file path from a cell in Microsoft Excel to the clipboard and have Finder open it using another program?
    the Microsoft Excel cell looks like this...
    Primary Hard Drive:Microstock 2.0:Automation Processes:Automating Folder System:Bright:Bright Series Choices Circles.jpg
    the script I have looks like this but won't work...
    tell application "Microsoft Excel" to copy range (cell "B1" of worksheet "Keywording 2.0" of workbook "Metadata")
    set thefile to (the clipboard)
    tell application "Finder" to open thefile using "Primary Hard Drive:Applications:Adobe Bridge CS4:Adobe Bridge CS4"
    tell application "Adobe Bridge CS4" to activate
    I get an error "Can't make "Description" into type item.

    There are several flaws with your script, which are compounding your problem.
    First off, you're using copy range within Excel, which isn't what you want - that's intended to copy a range of cells within a worksheet to another worksheet.
    Secondly, even if that did work, you really don't want to use the clipboard for this. There's no need, for a start, and it disrupts whatever else the user may have had on the clipboard. Just think of AppleScript variables as being an infinite number of named clipboards and you can see that you could easily use an AppleScript variable to pass the data between Excel and the Finder.
    So, first off, getting the data out of Excel, you want to get the value of the cell and put it in an AppleScript variable:
    tell application "Microsoft Excel" to set myFilePath to value of (cell "B1" of worksheet "Keywording 2.0" of workbook "Metadata")
    Now myFilePath has the path data, which you can pass to the Finder:
    tell application "Finder" to open file myFilePath
    (although there may be no need to use the Finder at all for this - you can open the file directly, or tell Adobe Bridge to open the file, but the point of using AppleScript variables still stands)

  • Using AppleScript/Automator to get file path and create AFP hyperlink

    Hi All,
    A colleague has asked for a service (contextual menu item in Finder) to get a selected item's remote (afp://) file path and copy it to the clipboard...  Pretty sure I've got that part down. 
    What I need advice on is how to make the resulting pasted file path into a serviceable hyperlink.  AFP keeps telling me there was an error connection to the server....  Does the copied path have to include mounting commands and user credentials for this to work??
    Thanks,
    Nathan

    Hi Richard - here's the script:
    tell application "Finder"
              set sel to the selection as text
              set TempTID to AppleScript's text item delimiters
              set AppleScript's text item delimiters to space
              set sel to text items of sel
              set AppleScript's text item delimiters to "%20"
              set sel to sel as string
              set AppleScript's text item delimiters to TempTID
    set the clipboard to "file://" & POSIX path of sel
    end tell

Maybe you are looking for

  • How to prevent BGP code 6 (Cease) subcode 6 (Other Configuration Change)

    Can anyone tell How to prevent BGP code 6 (Cease) subcode 6 (Other Configuration Change) ? We are facing frequent problem with this error. Please suggest how to stop this....  Note :- We are using BGP VPN between this peers. Logs : Date/Time     : 20

  • Lumia 928 - Black Update - Panorama Taken Pictures...

    I have a Lumia 928, updated it to black while in India.  I took some pictures using Panorama this weekend at a tourist location, and cannot find the files anywhere.  I have previously succussfully taked Panorama pictures and they have saved to the ca

  • BAPI to create Material master record

    Hi All, I need to create a new material master record using a reference Mterial number. Please let me know, if there is any BAPI to achieve this.

  • Convert Numbers to Excel Format

    How do i take a numbers spreedsheet and convert it to Exel so when I send it my buddy how has a pc can read it?

  • Outputting ResultSet into a JTextField

    I use this method to execute queries on the database public ResultSet runQuery(String s) throws java.sql.SQLException Statement stmt = connection.createStatement(); System.out.println(s); return stmt.executeQuery(s); For the query I'm having problems