Needing script to move files with name that starts with

Here is part of the script that takes a excel file for the list to duplicate files from one folder the another. I would like it to use file name starts with instead exact file name. If I can get this to work I will not have to have a try for .jpg and a seperate try for .eps
            tell application "Finder"
                try
                    duplicate (sourceFolder & theItem & ".jpg" as string) to destFolder with replacing
                on error
                    do shell script "echo " & theItem & ">> $HOME/Desktop/NotFound.txt"
                end try
                try
                    duplicate (sourceFolder & theItem & ".eps" as string) to destFolder with replacing
                on error
                    do shell script "echo " & theItem & ">> $HOME/Desktop/NotFound.txt"
                end try
            end tell
Thanks

Ok here is the script that I've been using for a couple of years now with no problems, until I upgraded. Don't know what happened, because I cant even use it on a older system that we have. The error I get is when it tries to get the value of selection from Excel. It times out with no values. Thanks for any help!
set sourceFolder to choose folder with prompt "Select the folder that contains images to move."
set destFolder to choose folder with prompt "Select the destination folder"
if sourceFolder is not destFolder then my moveImageFiles(sourceFolder as string, destFolder)
on moveImageFiles(sFolder, dFolder)
    script o
        property valuesList : {}
    end script
   tell application "Microsoft Excel" to set o's valuesList to value of the selection
    if class of o's valuesList is not list then return -- not multiple selection
    set tc to (count o's valuesList)
    set dFolder to quoted form of POSIX path of dFolder
    set errorFile to quoted form of POSIX path of (sFolder & "filesNotFound or NotMoved.txt")
    do shell script "/bin/rm " & errorFile & " > /dev/null 2>&1 &" -- remove the error file (if it exists)
    repeat with i from 1 to tc
        repeat with thisValue in (get item i of o's valuesList)
            if contents of thisValue is not "" then -- not a blank cell
                set tFile to quoted form of POSIX path of (sFolder & thisValue)
                try
                    do shell script "shopt -s nocaseglob; /bin/mv -f " & tFile & "* " & dFolder
                end try
            end if
        end repeat
    end repeat   
    do shell script "/usr/bin/open -b com.apple.textedit " & errorFile & " > /dev/null 2>&1 &"
end moveImageFiles

Similar Messages

  • HT1338 Problem with MAIL, when select names that start with "E" the mail freeze. Can't fix it.

    Problem with MAIL, when select names that start with "E" the mail freeze. Can't fix it.

    Now I checked the materials that I got from AT&T Yahoo and
    port 25 is used as the outgoing mail port, 110 for incoming.
    This is for the POP type account provided by AT&T, not necessarily for an email account and SMTP server not provided by AT&T.
    Sounds like AT&T blocks using an SMTP server that is outside of their network or not provided by AT&T on Port 25.
    Try the following first.
    Go to Mail > Preferences > Accounts and under the Account Information tab for your .Mac account preferences at the SMTP server selection, select the Server Settings button below for the .Mac SMTP server.
    Enter 587 in place of 25 in the Server Port field and when finished, select OK to save the changed setting.
    If this doesn't work, we will go to plan B.

  • [svn] 3794: Fix loading RSLs with URLs that start with "./" or "../"

    Revision: 3794
    Author: [email protected]
    Date: 2008-10-21 14:21:45 -0700 (Tue, 21 Oct 2008)
    Log Message:
    Fix loading RSLs with URLs that start with "./" or "../"
    QE Notes: Only one "./" is supported at the beginning of the path. Multiple "../" may be in the path, but only at the beginning of the path. No mixing of "./" and "../" is supported.
    Doc Notes: None
    Bugs: SDK-17696
    Reviewer: pfarland
    tests: checkintests, RSL mxunit
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17696
    Modified Paths:
    flex/sdk/branches/3.2.0/frameworks/projects/framework/src/mx/utils/LoaderUtil.as

    Oh I am using Dreamweaver to put it on the web :-)

  • How can i sort PDF's on IBook with the name that starting with numbers

    i import a number of pdf's representing ameeting agenda as the files names (1xxx,1.1xxxx, 2.xxxx,10.xxxx) on ibook , however the files sorted on a diffrent way as file start with 10 on first . so how can i sor the files on the IBook  with its name starting with numbers as1 &1.1 and so on.

    You seem to want a numeric sort but are getting a character sort.
    a number range  would be 0,1,2,3, ... 9,10,11 ...
    sorting like everything else with computers is an algorithm.  Someone needs to define how it works.  When you see a list of files, someone has defined how the list will be sorted. If you compare Windows file sorting to Mac files sorting you will find there are differences.
    In the case of files sorting, the files are sorted on characters from left to right. In file sorting the sorting algorithm does not try to determine that files are numbers.  All files beginning with a 1 will be sorted together becuase the file sorting althorithm doesn't look at the second character position before grouping all the 1's together.
    For what it is worth, there are multple books written on sorting.
    Robert

  • Problem with Spaces that started with Snow Leopard

    I've noticed two problems with Spaces that have arrived since switching to Snow Leopard... First, if I am in say Space 1 where I use Safari and I then want to move over to an open application, say like Excel, that I have running in Space 4, there are a number of ways to get there but one way I used to use all the time was to move down to the Dock and simply single click on the open Excel application and that would immediately switch me over to Space 4 and whatever Excel documents were already open there... Now, since switching to SL, a single click of whatever application in the Dock makes that application active in the Finder (you see its name appear in the upper left of the menu bar) but otherwise nothing happens... You then have to click a second time and then you switch over to Space 4... It's not really a double click because that implies to clicks closely spaced in time... For this, you can click once, leave the room, come back, click a second time and you will now switch to the alternate space where the open application is running... That is clearly different than it was under Leopard and I would suggest that it is a bug because there is no value in the outcome of that first click... It highlights the switched application but doesn't actually switch to it until you click a second time...
    Second, and this one is worse, if you say launch Excel (which you want to open in Space 4) while you are in Space 1, Excel will open and switch over to Space 4... So far so good... But now, with Excel open over in Space 4, if you are now back and working in Space 1 and while there you use the Finder to go to some other, currently unopened, Excel file and request that it open, it should switch over to Space 4 and open that file but instead it opens it wherever you are, in the case mentioned here, in Space 1... So now you have Excel files opened both in Spaces 1 and 4... Clearly a bug... Spaces had some similar issues in a few early versions of Leopard but they eventually got it working... Now it appears Spaces has regressed somewhat in SL... I love spaces and use it all the time... Hope it gets fixed soon... thanks... bob...

    Hi... I have since learned that the first paragraph of my original post where I say,
    "I've noticed two problems with Spaces that have arrived since switching to Snow Leopard... First, if I am in say Space 1 where I use Safari and I then want to move over to an open application, say like Excel, that I have running in Space 4, there are a number of ways to get there but one way I used to use all the time was to move down to the Dock and simply single click on the open Excel application and that would immediately switch me over to Space 4 and whatever Excel documents were already open there... Now, since switching to SL, a single click of whatever application in the Dock makes that application active in the Finder (you see its name appear in the upper left of the menu bar) but otherwise nothing happens... You then have to click a second time and then you switch over to Space 4... It's not really a double click because that implies to clicks closely spaced in time... For this, you can click once, leave the room, come back, click a second time and you will now switch to the alternate space where the open application is running... That is clearly different than it was under Leopard and I would suggest that it is a bug because there is no value in the outcome of that first click... It highlights the switched application but doesn't actually switch to it until you click a second time... "
    ...that turned out to be my mistake... In another post someone pointed out that in Spaces preferences you must have checked ON the preference that says,
    "When switching to an application, switch to a space with open windows for the application"...
    I had been playing with a number of things trying to figure out what was going on and somewhere in the mix had switched that off... (It is on on all my other computers and I'm sure it originally was on this one too)... When I switched it back on the above described problem went away... So that was my fault...
    But the second part,
    "Second, and this one is worse, if you say launch Excel (which you want to open in Space 4) while you are in Space 1, Excel will open and switch over to Space 4... So far so good... But now, with Excel open over in Space 4, if you are now back and working in Space 1 and while there you use the Finder to go to some other, currently unopened, Excel file and request that it open, it should switch over to Space 4 and open that file but instead it opens it wherever you are, in the case mentioned here, in Space 1... So now you have Excel files opened both in Spaces 1 and 4... Clearly a bug... "
    ...is a real problem... I fired up my G4 (power pc) that runs Leopard, 10.5.8, to see whether it behaves the above way or not and it does NOT... It works as one would expect.. So at least later in Leopard, the above mentioned problem was not present but it is in this first incarnation of Snow Leopard...
    To me, the utility of Spaces is all about keeping a single desktop from being cluttered with many open applications/files and to now have an application that opens in whatever space you happen to be in after it is first opened in its "correct" space sort of defeats the idea behind Spaces... I am currently trying to train myself to first hit <command><4> (my Excel space) before opening a second or subsequent Excel document to prevent it from opening somewhere where I don't want it to be...
    Again, I hope Apple sees and fixes this... I did submit an "Apple feedback" item for this issue... thanks... bob..

  • I have copied many photo's from another laptop to my Mac.  The older photo's are in directories with names that help me select what I need to view. I would like to have all my imported new photo's also bee added to the directory structure I have in Finder

    I have copied many photo's from another laptop to my Mac.  The older photo's are in directories with names that help me select what I need to view. I would like to have all my imported new photo's also bee added to the directory structure I have in Finder but my new photo's are all in iPhoto.  I want to use directories for storing and iPhoto for viewing.  Is this possible or do I need to have all my photo's in iPhoto??
    Mitch

    iPhoto is not a Photo Viewer. It's a Photo Manager and designed for looking after the files while you organise the Photos. It really works much better if you let it manage those files. If you use iPhoto you never go near those files because iPhoto is your start point for anything you want to do with your Photos - the point of the pplication.
    You can run iPhoto in Referenced mode, where it does not copy the files to the Library, but I caution you that you are making life a lot more difficult for yourself by doing that.
    How to, and some comments on why you shouldn't, are in this thread
    https://discussions.apple.com/thread/3062728?tstart=0
    Regards
    TD

  • I am a beginner with video. What software do I need to view .MOV files on my Dell Desktop?

    I am a beginner with video. What software do I need to view .MOV files on my Dell Desktop?

    .mov is Apple "Quicktime".  
    You should be able to download a player here:   http://apple.com/quicktime
    Tim Campbell
    5D II, 5D III, 60Da

  • Count files that start with a certain letter

    I need a simple script to give me a count of the files in a certain folder that start with "A" or some other character that I might choose.
    I tried this but got an error
    count every file name starts with "A" of folder ProofsOutFolder
    Thanks for the help.

    You can also approach it this way...
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">set theFolder to choose folder
    set theChar to text returned of ¬
    (display dialog "Enter Search Character:" default answer "A")
    do shell script "find " & quoted form of POSIX path of theFolder & ¬
    " -type f -name '" & theChar & "*'|awk 'END{print NR}'"</pre>
    Just another option to try out.

  • I am using Firefox 11 and I am unable to print web pages. I can print PDFs ok. I tried to open the prefs.js file to delete anything that starts with print and I get an error message.

    I cannot print web pages. I've tried the solutions suggested like deleting anything that starts with print in the prefs.js file but I get an error message: Script: c:\users\rick\appdata\roading\mozilla\firefox\profiles\iviwh5c1.default\prefs.js
    line: 1
    Char: 1
    Error: invalid character
    code: 800A03F6
    Source: Microsoft JScript compilation error

    When editing '''prefs.js''' you need to use a simple text editor program. WinXP Notepad messes up the line formatting of prefs.js, so I use Wordpad - but you need to save the edited file in a Text-Only format (Wordpad asks about that when you go to save the edited file). I never used Win7, so I don't know if that version of Notepad messes with the line formatting of prefs.js or not.
    Another thing - make sure '''''"Hide extensions for known file types"''''' is de-delected in Windows file / folder options > view -> advanced settings. Otherwise Windows may add a .txt file extension that you won't be able to see, and that will break that file in Firefox. '''prefs.js.txt''' won't be recognized by Firefox, when is expecting to find '''''prefs.js''''' .

  • How do add .mov files in Premiere Elements 11 with Windows 8? I get a generic error message.

    How do add .mov files in Premiere Elements 11 with Windows 8? I get a generic error message.

    Hi Steve,
    Thanks for your quick response. The original movies were taken on a Canon ES970 (1990's). I don't know the resolution but things were not as high tech back then.,.. I used a Roxio software to convert them on my MacBook Air. I didn't realize that I could use Adobe Premiere Elements to do that or I would have. However my old camera did not have a cable to attach it to a computer and the Roxio software came with it.
    I then saved the recordings on an external hard drive. I did not make movies from them using iMovie or edit them in any way. They are simply .MOV files and they can be played on my Mac. Upon realizing how much memory it takes to work on videos, I decided it might be easier to burn DVD's on my husband's  new Dell desktop that came with Windows 8. I downloaded Quicktime as suggested and still the movies can't be added to Premiere.

  • Hi - When I go into Contacts and type a letter in the search bar to get to last names that begin with that letter I get a list of random names that don't correlate to the letter. My settings are fine.  Help ?

    Hi. When I go into my contacts and type a letter in the saerch bar to get to a list of last names that begin with that letter I get a list of random names that don't begin or end with the letter.  My Settings appear fine.  Any insights would be greatly appreciated.  Cheers Bill

    The search bar is not designed to take you to names beginning with the letter you put in. If you want to do that, use the letters down the side. In the search bar, the device will return results for all contacts that have that have that letter in them. If you type a couple of letters of the name, you'll find what you want faster. Once you get used to how it works, it's quite efficient.
    Best of luck.

  • What are the weird files that start with ._ that pc users get when I send zips?

    When I send files that I zip using Stuiffit to pc users they get the files plus an equal number of files that start with ._ Does anybody know what these are and how to get rid of them?
    Thanks!
    Karen

    Dot files are invisible files that OS X uses to display positions of files and folders icon for instance when you open a folder.
    That is indeed what a .DS_Store file does, but that's not the ones Bogies is referring to.
    There are various other items that start with a period, such as .Trashes. Every drive gets a trash folder, just as Windows does to each of its drives. While it hides its own trash folders from view, Windows doesn't recognize OS X's version of the trash folder, so you see it.
    But you're likely talking about these. Every file you copy from OS X to a DOS/Windows formatted drive gets a ._ file. The Mac OS has a twin file system; the data fork, and the resource fork. Windows has only a data fork.
    In order for OS X to maintain the resource fork data on a Windows drive, it has to write the resource data as a separate data fork file. So a file named foo.tif will also get a ._foo.tif file on the drive. Mac users don't see them since UNIX automatically hides anything that starts with a period. When you copy the file back to OS X, the data and resource fork info is combined again into a normal Mac file.
    Most of the time, removing these are no big deal. They hold simple data like Type and Creator codes, modification dates, icons, etc. Others, like Mac Type 1 PostScript or Mac legacy TrueType fonts have all of the font data in the resource fork. Delete the ._ files for those types of fonts, and you're left with nothing.

  • One of my imported MOV files turns "black" after editing with it for a time and I can't retrieve the images. This has happened three times, only this file. The placeholder is still there. Files are fine on hard drive. What gives? how to stop this?

    One of my imported MOV files turns "black" after editing with it for a time and I can't retrieve the images. This has happened three times, only this file. The placeholder is still there. Files are fine on hard drive. What gives? how to stop this? is in final cut pro 10.1.4

  • My MacBook Pro gets really hot when I open a video file of any kind and the video starts lagging and the image fades away, also with anything that starts the fan. Is extremely hot on the left upper corner. Is there something I can do about it?

    My MacBook Pro gets really hot when I open a video file of any kind and the video starts lagging and the image fades away, also with anything that starts the fan. Is extremely hot on the left upper corner. Is there something I can do about it?

    You are still under warranty.  Call Apple Care. Make sure you get a case number as all repairs have an additional 90 days of warranty. 
    #1 - You have 14 days from the date of purchase to return your computer with no questions asked.
    #2 - You have 90 days of FREE phone tech support.
    #3 - You have the standard one year Apple warranty.
    #4 - If you've purchased an AppleCare Protection Plan, your warranty last for 3 years.   You can obtain AppleCare anytime up to the first year of the purchase of your computer.
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired.

  • Do I really need to keep all the preloaded apps that came with my MacbookPro 13'' mid 2010

    Do I really need to keep all the preloaded apps that came with my MacbookPro 13'' mid 2010? Which one are necessary to keep from your experience. Thanks

    Lots of apps are preloaded on a new MBP. Tell us which ones you don't think you need, and we'll tell you whether you can safely get rid of them.
    However,  the total space used on your hard drive by all the apps that are preinstalled is very small, and if there's any chance at all that you may eventually want to use them, you might as well keep them handy.
    By way of example, my own Applications folder contains everything that came from the factory preinstalled in it, plus 2.5 years of subsequent additions totalling 196 applications of all kinds and sizes. Still, it only occupies 12.5GB of my 500GB hard drive.

Maybe you are looking for

  • How do I get a CD out of a computer that won't start?

    My computer has been freezing up. Usually if I let it cool off a few hours it will start again, but when I tried today it froze up during startup. I've got a CD in the drive. How do I get it out without trying to reboot the computer and possibly doin

  • Cannot change image size dimensions

    the program will NOT let me enter values  or change dimension values, can anyone help?

  • Session variables or ???

    First I should say I am very much a novice at web design, so please go easy on me! :) I am trying to create a "confirmation page" which will display a recap of information input by the user from an online registration form. I created a register page

  • Can't insert transitions properly

    I was working on a project, had inserted a few fade transtitions and then something really weird started to happen: instead of the transitions being the standard 1 second (1;00) in length, they are now only 1 frame (;01) in length. Even if I ctrl-cli

  • Need to tune the sql query

    Hi, PLease help me to tune the query select primary_rep, rep_ssn, nvl(product_type_desc, 'UNKNOWN') as productName, ROUND(sum(contributions)) as contribution, ROUND(sum(withdrawls)) as withdrawls, ROUND(sum(netflow)) as netflow from dev.NETFLOW_VIEW_