File Copy to Clipboard includes path - how to avoid

I'm writing an Automator action that does several actions to whatever file in the Finder is selected (or right-clicked).
The first action in the Automator action is Copy To Clipboard. This works, however, it copies the entire absolute path of the file (Macintosh HD:Users:myusername:Desktop:filename).
I'd like it to only grab the actual filename, not the entire path. Is there a way to do that?

add the following "run shell script" action before the action that copies the file to the clipboard:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
for f in "$@"
do
basename $f
done</pre>
set to pass input as arguments for that action.

Similar Messages

  • Missing files - iTunes using wrong path, how can I change it?

    Hi,
    I store my itunes library on an external hard drive and I have over 1000 music files which itunes cannot locate even though they are there.
    Having done a bit of research I've discovered that the path for these files is incorrect.
    The path in "Get Info" for a missing track shows the path as:
    file://localhost/Volumes/Public/My Music/iTunes/iTunes Media/Music/Artist/Album/Song.xxx
    The path for a working track shows:
    /Volumes/Public/My Music/iTunes/iTunes Media/Artist/Album/Song.xxx
    So the missing ones have the extra "file://localhost" which I don't think should make a difference, but they also have an extra "Music" folder.
    Is there a simple way to correct this for all the missing tracks?
    Thanks!

    https://discussions.apple.com/message/20401436 - turingtest2 11/2012 post on rebuilding empty/corrupt library from previous iTunes library file after upgrade/crash.  -- Possibly not what you want to do since your old library file may be very out of date.  You don't say if this happened because you were updating iTunes right now in which case this might be the best way.  If you recently did update you can take the archived library file and move it and rename it so it now becomes the library.itl file iTunes is using.
    A slightly different approach to rebuilding, using a copy of the library file that is stored in a different format (.xml).  It is up to date as regards to your main library file though it does omit some of the things I mentioned in an earlier post.
    iTunes: How to re-create your iTunes library and playlists - http://support.apple.com/kb/ht1451 I'm going to copy and paste, and edit the applicable section since it's a bit mixed in:
    Re-creating the iTunes Library file
    Note: After re-creating your library, any devices that you sync with iTunes  (Apple TV, iPod, iPhone, iPad) will see your iTunes library as a new  library and will completely resync. The next sync with such a device will take longer and may reset some options since your rebuilt library isn't familiar to the device.
    1. Quit iTunes.
    2. Locate your iTunes folder (this is the folder that contains the iTunes Library and iTunes Library.xml files).
    /Users/[your username]/Music
    3. Open your iTunes folder.
    4. Drag the "iTunes Library.xml" or "iTunes Music Library.xml" file to the Desktop. If neither is available, learn how to add files back to the Library (because the XML file is not available, playlists and other information will not be available).
    5. Drag the following file from your iTunes folder to another folder.  The file can later be trashed:
    "iTunes Library" or "iTunes Library.itl"
    6. Open iTunes.
    Important: Do not add any content into iTunes at this point (such as by purchasing something from the iTunes Store).
    7. Choose File > Library > Import Playlist.
    8. Navigate to the "iTunes Library.xml" file on the Desktop.
    Mac users: Click Choose.
    If the above does not work we will need to edit the .xml file you are storing on the desktop  because it is derived from your .itl library file and it too may have the broken links in it.  It's the "file://localhost" stuff that's causing the problem.  The links aren't truly invalid, it's the fact that iTunes for some reason is inserting the localhost stuff that's causing iTunes to see them as broken links.  This can be edited  using a search and replace with a text editor, if necesssary.
    For what it's worth, if you don't have too many broken links you could fix them by hand, but it's not fun.
    Note, in addition to backing up your whole iTunes collection periodically, it is worth occasionally backing up the library file in case it becomes corrupt (as it is now in a way).

  • How to include a file as variable in %@ include file tag.

    Hi,
    I have a interesting problem here, how can I include a file in <%@ include file tag. where the include file path is a variable. I am trying to implement the following statement.
    <@ include file="<%=headerLogic_template %>">
    where headeLogic_template is a variable which contains the actual path of the include file.
    Thanx,
    Ramana.
    email:[email protected]

    Please note that you can not write anything else between the quotes nor for page specification or parameters.
    BAD EXAMPLE!!
    <% for (int i = 0; i < 20; i++) { %>
    <jsp:include page="included.jsp" flush="false">
      <jsp:param name="apa" value="prestring_<%=i%>"/>
    </jsp:include>
    <% }BAD EXAMPLE!!

  • How to measure progress of file copy?

    One of the requirements for my AIR application is to copy
    large files from one location to another on the client computer.
    I've been using the copyToAsync() method in AIR, but unfortunately
    this does not trigger progress events. Copying gigabyte files that
    take several seconds becomes pretty uncomfortable for users, when
    they can't see the progress.
    Does anyone know of an alternative or workaround? All I need
    to do is copy a file from one location to another, and measure the
    progress while that is happening.
    Since I control the client machines (it is a closed
    environment), I have the option to setup file servers on every
    machine and use the file download control with Flash instead of
    file copy. However, when I investigate this option it seems that
    the file download control will always trigger user interaction to
    select the target path (which I don't want -- I want to
    programatically select the source files and the target directory).
    If someone knows a solution to that problem I would happily take it
    and move on :)

    Hi,
    Use 2 FileStream objects in async mode (openAsync). One to
    read and another to write. When you read in async mode, you get
    progress events. When they fire, you can read bytesAvailable
    amounts of data and write that to the output filestream.
    The output filestream can listen for output_progress events
    to ensure that new data can be written to it or not.

  • I converted aif files to mp3 files in I tunes so I could put them on a flash drive.  Now when I transfer an album to the flash drive I get both the aif files and the mp3 files in the flash drive.  How do I get the iTunes to only copy the smaller file?

    I converted aif files to mp3 files in iTunes so I could put them on a flash drive.  Now when I transfer an album to the flash drive I get both the aif files and the mp3 files on the flash drive.  How do I get the iTunes to only copy the smaller file?

    My suggestion to use the smart playlist was more along the lines of making one list with rules to show everything in your library as long as it was kind "mpeg" (= mp3).
    Smart playlists cannot be edited manually, only by changing the rules.  You can use them as the basis for another smart playlist though.
    There is added overhead to using smart playlists, so don't go overboard.

  • How can I find out the progression on a file copy operation

    I was wondering how when I use a file stream to copy a file how much is done and how much I have to go?

    You can't. A FileInputStream gives you no method of obtaining the size of the file.
    If you have access to the File object used to create the stream then you can get the size of
    the file from that.
    Copying from a FileInputStream to a FileOutputStream will require you to use one of the
    read methods. These allow tell you (and some allow you to set) the numbe of bytes copied
    in that call. If you know how many bytes are copied in each call and also know how many
    bytes there are to copy then you can tell how far you have progressed.
    Using a RandomAccessFile as the source also allows you to determine the size of the file.
    Using FileChannels can be significantly more efficient and also allows you to determine the
    size of the source file.
    matfud

  • How to set local file copy buffer size?

    Is there any sysctl parameter or any other mechanism to set or change file copy buffer sizes? I'm backing up a huge number of files to a local hard drive connected by firewire, and I'd like to play with file copy buffer sizes for the best performance. The machine used is a new macbook pro running OS-X 10.6.7. Any ideas?

    Here is a bash script that uses the dd command to copy a file.  Use the -b option to set the file size.
    example:
    /Users/mac/config/forumcopy.command -vb  4096  /Applications\ \(Mac\ OS\ 9\)/Civilization\ II/Civ\ II\ Map\ Editor  /Applications\ \(Mac\ OS\ 9\)/Civilization\ II/Civ\ II\ Map\ Editorv8
    I haven't tested this a lot. 
    Of course, I haven't figured out how best to post code.  Trying HTML mode. Using the <pre> tag.
    #!/bin/bash
    # macteracopy [ -b blocksize ] [-v ] [-V ] input_file output_file
    # Purpose of this script:
    # Copy a file with optional block size. Default size of 4096.
    # Notes:
    # chmod u+x macteracopy
    # You may have to restart the finder to notice a customized file icon.
    #   Copyright 2010 rccharles
    #   GNU General Public License
    #   This program is free software: you can redistribute it and/or modify
    #   it under the terms of the GNU General Public License as published by
    #   the Free Software Foundation,  version 3
    #   This program is distributed in the hope that it will be useful,
    #   but WITHOUT ANY WARRANTY; without even the implied warranty of
    #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    #   GNU General Public License for more details.
    #   For a copy of the GNU General Public License see
    #   <http://www.gnu.org/licenses/>.
    # debug info
    export PS4='+(${BASH_SOURCE}:${LINENO}):'
    ## not in the tiger version of bash ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
    declare -x   verbose="No"   \
             veryVerbose="No"
    blockSize=4096
    # Check for command-line options used when calling the script
    if [ $# -gt 0 ] ; then
       while getopts "b:vV" Option ; do
          case "${Option}" in
          b  )  blockSize=$OPTARG
          v ) verbose="Yes"
          V ) veryVerbose="Yes"
          \? ) echo 'usage macteracopy -b blocksize -V input_file output_file'
          * ) echo "Unknown argument among arguments $* on command line."
             exit 6
          esac
       done
    fi
    # We're done with switches / options from the command line
    shift $(($OPTIND - 1))
    [ "${veryVerbose}" = "Yes" ] \
       && set -x  
    inputFile="${1}"
    outputFile="${2}"
    [ "${verbose}" = "Yes" ] \
       && echo \
       && echo "$0 script revised $(GetFileInfo -m $0)" \
       && echo
    [ ! -f "${inputFile}" ] && echo "File not found.  ${inputFile}" && exit 4
    [ -d "${inputFile}" ] \
       && echo "Directories are not supported, yet.  ${inputFile}" \
       && exit 4
    [ "${veryVerbose}" = "Yes" ] \
       && ulimit -a \
       && df \
       && echo
    if [ "${verbose}" = "Yes" ] ; then
       dd bs=${blockSize} if="${inputFile}" of="${outputFile}"
         dd bs=${blockSize} if="${inputFile}/rsrc" of="${outputFile}/rsrc" 
    else
          dd bs=${blockSize} if="${inputFile}" of="${outputFile}"
          dd bs=${blockSize} if="${inputFile}/rsrc" of="${outputFile}/rsrc"
        } 2>/dev/null
    fi
    [ "${verbose}" = "Yes" ] \
       && echo \
       && ls -l "${inputFile}" \
       && ls -l "${inputFile}"/rsrc \
       && GetFileInfo  "${inputFile}" \
       && ls -l "${outputFile}" \
       && ls -l "${outputFile}"/rsrc \
       && GetFileInfo  "${outputFile}" \
       && echo
    SetFile  -a $(GetFileInfo  -a "${inputFile}"  ) \
           -c $(GetFileInfo  -c "${inputFile}" | sed 's/"// g' ) \
             -t $(GetFileInfo  -t "${inputFile}" | sed 's/"// g' ) \
             "${outputFile}"
    [ "${verbose}" = "Yes" ] \
       && echo "after SetFile" \
       && GetFileInfo  "${outputFile}"

  • In dreamweaver mx 2004 and dreamweaver cs4, how I configure, when download/upload do not ask me to include DEPENDED FILES but act without including ?

    in dreamweaver mx 2004 and dreamweaver cs4, how I configure, when download/upload do not ask me to include DEPENDED FILES but act without including ?

    Open the Preferences panel (Edit menu on Windows, Dreamweaver menu on a Mac), and select the Site category. There are two checkboxes there for dependent files. Make sure both are selected. The Dreamweaver default is NOT to upload/download dependent files. You need to click Yes, if you want the dependent files to be included.

  • 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.

  • I received error message that 6 of my songs I purchased on a workout album could not be copied because the file could not be converted. How do I get these 6 songs to download on my ipod shuffle?

    I received error message that 6 of my songs that I purchased on a workout album could not be copied because the file could not be converted.
    How do I get these 6 songs downloaded to my ipod shuffle?

    I can think of only one reason a song would be "converted" while it is being loaded on a shuffle.
    Select the iPod in the iTunes sidebar, under DEVICES.  Over to the right, depending on iPod model, go to the Summary or Settings tab.  There should be a setting there that says Convert higher bit rate songs to 128 kbps AAC (the 128 kbps part may be adjustable).  If that checkbox is checked, try unchecking it.
    NOTE:  This setting may allow more songs to fit on the shuffle, but for any converted song, the sound quality will become inferior.  So I don't use it.

  • Simply put, I do not like like the new color coding "dots" and I do not like having to press the Command key before double clicking to open files in a new window. How hard would have been to include the old version of these two features?

    Simply put, I do not like like the new color coding "dots" and I do not like having to press the Command key before double clicking to open files in a new window. How hard would have been to include the old version of these two features?

    Apple - Mac OS X - Feedback

  • My 16GB iPhone 4S has 4.40GB of "other" file. What does this include and how do I reduce it? Kindly help me.

    My 16GB iPhone 4S has 4.40GB of "other" file. What does this include and how do I reduce it? Kindly help me.

    Text messages, MMS messages, email, music catalog, operating system settings, safari cache, siri cache, Genius data (if enabled), game center data -- esentially everything on your phone that isn't explicitely listed in the bar chart at the bottom of iTunes on your computer.
    Sometimes there is also data corruption on the phone that ends up in Other. To get rid if it try restoring the phone with iTunes. If that makes no difference the corruption is in your backup; restore again as a new phone, then add content back.

  • Photoshop Elements 9 won't open blank files or copy from clipboard

    PE9 for Macwon't open blank files or "copy from clipboard."  I get error messages that say, "Could not complete the command because of a problem using the Adobe color engine," when I try to create a new blank file, and "Could not place because of a program error" when trying to "copy from clipboard."  I tried reinstalling the software, but that didn't help.

    Are you still facing the same problem ?
    can you try it after resetting your preferences.
    To reset your preferences at the time of launching PSE press command+option+shift key combination untill following pop up comes.
    Addi

  • I have a video clip on IPhoto that is MPG file.  It won't copy to the IPAD.  How can I make it work on IPAD?

    I have a video clip on IPhoto that is an MPG file.  It won't copy to the IPAD.  How can I make it work on IPAD?

    http://www.apple.com/ipad/specs/
    Video formats supported: H.264 video up to 720p, 30 frames per second, Main Profile level 3.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format.

  • HT1926 My installation of Itunes to syne my iphone with PC was missing AppleApplicationSupport.msi  after 2 installs how can I install such a file do you have a path for this

    My installation of Itunes to syne my iphone with PC was missing AppleApplicationSupport.msi  after 2 installs how can I install such a file do you have a path for this

    Hi kensb!
    I would recommend that you attempt to reinstall all of the programs and components of iTunes on your machine and reinstall everything again. It can be tricky to get everything uninstalled, so we have an article that can help you make sure you uninstall everything:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/ht1925
    or
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/ht1923
    Specifically, when it comes to uninstalling, you will want to uninstall applications in this order:
    Use the Control Panel to uninstall iTunes and related software components in the following order. Then, restart your computer.
    iTunes
    QuickTime
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Important: Uninstalling these components in a different order, or only uninstalling some of these components may have unintended effects.
    You will then want to follow the links in those articles to download the latest package of iTunes software for your computer and install again from there. Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

Maybe you are looking for

  • Bridge CS4 Photo Downloader Date Created

    Quick question. When using the Adobe Bridge CS4 Photo Downloader to download pictures from a camera, how do I keep the original shot dates (date created) to show up in the Finder Info. Seems like it's just putting the date modified (downloaded date a

  • Balances Upload in SAP from Bus Area to Com Code

    Dear All, I am looking for the steps to upload balances in SAP. Below is the scenario. Earlier we had business area say X under company code say ABC Now that business area is converted as separate company code in system say PQR. with Business area Y

  • Problems using very large XSD in Message Mapping - POSLog

    Hi, I am trying to build a message mapping based on an external definition (.xsd) downloaded from the ARTS webpage (Association for Retail Technology Standards). In PI (7.0) I am able to succesfully create an External Definition based on the download

  • Switching between apps launched through RemoteApp from Windows 2008 R2 server

    I have a problem with RemoteApp on Windows 2008 R2 Standard SP1. When I try to switch between apps, launched from RD Web Access web-page, it is not always succeded. Instead of it the target app blinks and I still remain at the previous app. In anothe

  • 32 Bit Image to Image Array

    I am attempting to get an image array from a 32 Bit image.  I attempted to use IMAQ ImageToArray.  This did not work when passing in a 32bit RGB image.  It works fine after I convert the image to 8 or 16 bit image, but this is a step I am attempting