Prepend to specified filenames not working

i have the following script as a test for something i need to
do. i'm having a problem where the script is trying to use
the entire path and filename instead of just the filename.
what am i doing wrong?
the idea is to prepend a string to a filename if the file
is a .mov file. instead of naming the file to 200902_27_@_15-15-28___00001.mov,
the script is erroring and telling me it is trying to rename
the file to the entire filepath + 200902_27_@_15-15-28___001.mov.
thanks,
BabaG
set thename to "200902_27_@15-15-28"
set thefolder to "1400GBRaid-A:CanonHD:" & thename & ":PRIVATE:AVCHD:BDMV:STREAM:"
tell application "Finder" to (get every file of folder thefolder whose name extension is "mov") as alias list
repeat with AnItem in the result
tell application "Finder" to set name of file (thefolder) to thename & "__" & (AnItem as text)
end repeat
Message was edited by: BabaG
Message was edited by: BabaG

In your repeat loop, AnItem will be one of the items returned from your previous statement getting all of the files whose name extension is "mov". It is already the full file path and is in a form the Finder likes (alias), so all you need to do is deal with the name, for example:
tell application "Finder" to set name of AnItem to "__" & (get name of AnItem)

Similar Messages

  • Remove numbers in front of file[working] + append number to duplicate filenames[not-working]

    Hi all,
    I have an AppleScript which removes any numbers and/or hyphens and underscores from the beginning of a filename. Thats works fine.
    However, sometimes i might have a situation like this:
    Filename Eg;,  01-Dog.jpg,  02-Dog.jpg,  03-Dog.jpg, etc.
    In such a case, the script stops/does not run, only telling me that there already is a file with that name. It does not tell me which file its conflicting with (sometimes there are ALOT of files to look through).
    Could somebody please help in modifying this script so that in such a case, a file with the same name would have a number OR letter appended to the end of a filename (before the extension). 
    Eg;, Dog2.jpg, Dog3.jpg, etc.
    on run {input, parameters}   repeat with thisFile in input   tell application "Finder"   set filename to name of (thisFile as alias)   set filename to (do shell script "echo " & quoted form of filename & " | sed 's/^[0-9_-]*//'")   set name of thisFile to filename   end tell   end repeat   return input end run 
    Thank you for your help!!

    If anyone should be interested in such a script, @jweaks helped me out on StackOverflow

  • Error submitting form for Distribution: "The filename you specified is not valid because it does not

    Error submitting form for Distribution:
    "The filename you specified is not valid because it does not include a .pdf extension, contains one or more invalid characters or teh path preceding it refers to a protected system location."
    Tried removing dashes from filename, shortenign filename, moving to root directory. No changes. File ends with a .pdf extension.
    This is my first attempt to distribute via acrobat.com

    I found that I got that same message using Acrobat Professional to send out a document for shared review.  I had an exclamation mark in the title of the PDF. When I took out the exclamation mark, it worked.
    So maybe try taking out anything "unusual" (parentheses, dashes, exclamation marks, etc.) in the file name and see if that helps.
    Good luck,
       Philip.

  • Not Working exportData("filename.xdp")

    Why not working xfa.host.exportData("filename.xdp"); with acrobat Professional
    Thanks

    Lots of other people are having this issue- can you elaborate on "it was the client computer"?
    Were you able to change something on the client to fix this? If so- what?

  • Sender file adapter - filename containing  *  does not work

    Hi All,
    I am doing simple file-file scenario wherein my filename is something like
    MATMAS05_XI20070911-150159-088.xml 
    there are many files having similar kind of  name which are supposed to be picked
    so simply I can go on writing <b>MATMAS05_XI*.xml</b> in filename
    it is not working.. communication monitoring gives error <i>Error occurred while connecting to the FTP server "10.25.117.237:21": java.lang.NullPointerException</i>
    But  when I use character '?' then it works fine - '?'  placeholder for each extra character
    I am on SP 20.My adapter is configured properly. FTP server working fine with '?' or simple filename. So bit confused why it is not working with *
    Are there some BASIS settings which have to be in place to work it out with * ?
    All your inputs are welcome !!
    Thank You,
    Mugdha kulkarni

    Hi
    this error is not related to multimple files or sending with the * char.. you can use it
    see the below link
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    The error related to the server connection.. also check the ip address is correct or not you configured correctly or not..
    also clarfity the correct error description ..
    Chilla

  • Reply to all using ItemReply does not work when specifying messageid

    Hello everyone,
    I am trying to use the ItemReply token to perform a "Reply to All"
    action on a mail item with a known message identifier and include the
    original message text in the response. According to the documentation,
    the call should be:
    ItemReply(7;1;"message-id")
    Still, when I execute this token, apparently only a normal reply action
    is performed because only the original sender is listed as recipient.
    (The message text is properly included)
    However, when I manually select the message in the GroupWise client
    first and then execute the same call without specifying the message id,
    all recipients of the original mail are listed in "To:" as expected:
    ItemReply(7;1)
    Could it be that the "ReplyTo" parameter is ignored or does not work
    when a message id is specified as parameter? (Setting "IncludeText" to 0
    does not change anything)
    Thanks in advance and best regards,
    Peter Hofer

    Worth bumping this message. I find the exact same behaviour as mentioned 5 years ago. Using both GW8 and GW2012.
    According documentation, when MessageId is not specified it defaults to the command ItemReplyOpenItem(). I assume that the reason "Reply To all" works without a MessageID is because of that. Someone needs to give a look to ItemReply().

  • "Show all filename extensions" does not work!

    I want to be able to see the file extensions of all my files.  I go to Finder->Preferences->Advanced, and then I check the "Show all filename extensions" checkbox, yet it still does not work!  I tried rebooting my computer and double checking if that checkbox is still checked, and it is, and it still does not work!
    Any help?

    Nevermind.  I figured it out.

  • Specified Sort Order not working correctly in InfoView

    Hello All,
    We are running Crystal 2008 version 12.2.0.290 with Infoview 12.1.0 and are having a problem with specified sort orders working correctly.  In Crystal we are using the 'Chart Expert' to set the specified order of the percent bar chart.  It works just fine in Crystal 2008 and shows the stacked bar in the order we would expect.  We then save the report to InfoView and run the report on a schedule and it comes back in a completely different order. Not the order we specified in designing the report.  Any ideas on what is going on?
    Thanks in advance.

    We are experiencing a similar issue with the sort order in Infoview. We are using Crystal XI.5.8.26 and Infoview.
    The specified sort order works correctly in Crystal but in Infoview it comes back with a different order. Are there any suggestions on resolving this disparity?
    Thank you.

  • Firefox has repeatedly gone into "Not responding", needing me to force close it (or it will bomb out eventually) - always with Hotmail, possibly related to "Error! Filename not specified." being added to some e-mails when using FF .... any ideas?

    Not much more to add, other than this current and very interesting thread elsewhere:
    http://www.google.co.uk/support/forum/p/gmail/thread?tid=3ed94668bd00125f&hl=en
    I first picked out Firefox as being a common feature to the words "Error! Filename not specified." being added to e-mails (the thread talks about gmail, but I am finding it with Hotmail too) and other contributors note FF has suddenly started locking up unusually frequently. FF has always been stable for me with Hotmail until now - other (non-email) web sites are okay. I have McAfee Internet Security and Ad-Aware installed, both up-to-date and both show the PC to be clean. I've also updated all plugins etc - again, the problem persists.

    Okay, it's McAfee Site Advisor clashing with Firefox (I'm running FF v3.6.13). Disable McAfee Site Advisor by:
    Firefox > Tools > Add-ons > Extensions > McAfee Site Advisor > Disable and re-start Firefox.
    Stability returns to Firefox, Hotmail no longer locks up and no longer adds "Error! Filename not specified." and a bunch of grey squares to the end of sent e-mails.
    Thanks to those at:
    http://www.google.com/support/forum/p/gmail/thread?tid=7c144d837db89ac6

  • Specifying DELAY for enqueue does not work

    Oracle 8.1.7
    I am experiencing a problem with the DELAY feature for the message property when enqueuing a message. The delay interval I specify is 2 seconds, and when I look at the message in the aq$aq_table_name where queue = 'QUEUE_NAME' AND msg_state = 'WAIT' after enqueue, the message is there, with the correct time in the delay column. Unfortunately the state of the message never changes to READY when the delay time is up. I do have a suspicion that there is a problem with the background time-manager deamon not working, but I am not able to find any information as to how to control it. Any help would be extremely appreciated. Thank you in advance
    Regards,
    Kamen

    Hi Kamen,
    Please make sure that system parameter aq_tm_processes is set to more than 1.
    cheers,
    Brajesh.

  • SCVMM 2012, Conntect via conosle does not work when logged in with specified credentials

    Hi all
    I have a problem with the SCVMM 2012 console. When I start the console I select the "Specify credentials" option and then I enter my admin credentials. Afterward the console opens
    and everything works except the "Connect via Console" function.
    When I try to connect to a VM I get the following message:
    Virtual Machine Manager lost the connection to the virtual machine for one of the following reasons: Another connection was established to the console of this machine. The virtual machine has been shut down or put into the saved state. The user credentials
    provided do not have the necessary privilege to connect (0x0003, 0x0300)
    It seems that the Virtual Machine Viewer runs not under the admin credentials which I enter at the beginning and therefore the console cannot connect.
    Has someone the same issue ? Is it by design that the console connection does not work with specified credentials or is a sort of a bug or error ?
    Thx
    J0fe

    Being new to SCVMM, I've just come across this issue myself, though I came to a different (not necessarily better, but good enough for me) resolution.
    I have a somewhat convoluted but not abnormal configuration where the SCVMM server lives in a separate untrusted forest to that which the Hyper-V Server hosts live.
    As people have noted in this and other threads, the VirtualMachineViewer.exe process launches in the same security context with which you logged onto your pc. While the VmmAdminUI.exe process also runs in the same security context,
    the network logon it issues makes use of the credentials provided at the SCVMM MMC's logon screen, which VirtualMachineViewer.exe does not.
    I elected to use Credential Manager to resolve this issue.
    In Credential Manager, I created a "Windows Credential" entry where the hostname matched the FQDN of the hostname that appears within SCVMM as the virtual host entry. Using an IP does not match if you've used an FQDN in the SCVMM
    registration, and vice versa. If you used an IP for the host in SCVMM, then you need to supply that IP as the hostname in Credential Manager, and likewise if you used a FQDN.
    This solution isn't perfect as it requires you to manage numerous Credential Manager entries (one per host), but that still appealed to me far more than one per guest. If I had a larger environment, I'd script the account configuration
    given it only needs to happen once per host, rather than on an ongoing basis of once per guest as some of the above approaches would require.
    I haven't tested the different combinations to verify the least permissions required. For the time being I've gone with the model of using a non-privileged domain user account (to avoid managing multiple identities and passwords)
    which I added to the local Administrators group of each Hyper-V Server host. This stuck me as being a sound enough compromise between rigid security and ease-of-administration (given the per host arrangement in Credential Manager).
    With the account correctly specified in Credential Manager, I'm able to move on past the 0x0003 error and successfully use the remote function.
    If I was to point out an upside to this, it would be that this approach would allow me to remote Hyper-V servers in untrusted forests (including workgroups), which is something I couldn't do if the VirtualMachineViewer.exe process
    did in fact use my SCVMM credentials alone. Ultimately, that's something you have to come to terms with yourself, though.
    Cheers,
    Lain
    Thanks a bunch Lain, this helped! I'd still consider this a bug, however, and not a workable solution for a large number of servers/admins... But for now this does the trick, thanks!

  • Condition specified in expression 2 is not working as expected

    I have an application variable that I'm setting in a page-level computation. It is conditional: it should only be (re) set when :request is not Delete, and when the application item is either null, or when a specific string is NOT contained in the application item. I have the condition type as PL/SQL, and am using both expression 1 and expression 2.
    Expression 1:
    nvl(:REQUEST,'DELETE') <> 'DELETE' (this condition is working)
    Expression 2:
    nvl(instr(:MD_Refresh_Tables, 'HDB_SITE'),0) < 1)
    (this condition is not working. :MD_Refresh_Tables is the application item being
    set. And I've checked out the SQL in sqlplus and it's doing what I think it is.
    However, when MD_Refresh_Tables contains 'HDB_SITE', the computation is
    still being made, which is problematic for how I want to use this variable,
    because it then contains 'HDB_SITE' more than once.)
    Am I not understanding how expression 1 and expression 2 are used in conjunction with each other?
    thanks,
    Carol

    Carol,
    You start with a specific condition type. Depending on the type, it may require neither Expression 1 nor Expression 2, or it may require Expression 1 only or it may require both Expression 1 and Expression 2. The type of condition, i.e., its name, suggests which, if any, of those two fields would be required. If your condition type is PL/SQL Expression, you put the PL/SQL Expression in Expression 1 and leave Expression 2 empty.
    Scott

  • Ole_excel.WorkBooks.Open(filename)  is not working 64bit ms Office 2013

    Hi
    Please I am looking for your help to fix the problem while working with 64bit windows 7  with office 2013  , the following command is not working
    Please help  it would be very appreciate.  The following is my code
    ole_excel = CREATE OLEObject li_rtn = ole_excel.ConnectToNewObject("excel.application") IF li_rtn  = 0  THEN l_str_dir = is_filename li_nextrow = l_lng_rowcnt + 1 li_lastrow = li_nextrow + 1 ole_excel.visible = true ole_excel.Application.DisplayAlerts = False ole_excel.WorkBooks.Open(l_str_dir)  //  Error is coming here ole_workbook = ole_excel.application.workbooks(1) ole_worksheet = ole_workbook.worksheets(1) End if
    Please help
    With Thanks Polachan

    To conclude:
    Win 7 -> x64
    Office 2013 -> x86
    Your application -> x86
    I wonder if the error comes after:
    ole_workbook = ole_excel.application.workbooks(1)
    or after:
    ole_worksheet = ole_workbook.worksheets(1)
    The last command could also be written as:
    ole_excel.Application.ActiveWorkbook.Worksheets[1]
    That way ole_workbook = ole_excel.application.workbooks(1) isn't needed...
    I wonder why you use ole_workbook = ole_excel.application.workbooks(1). Is there any possibility you will open and work with two workbooks concurrently?
    Andreas.

  • WebLogic 9.0 - HTC files not working when specified as a part of cascading

    Same problem as described in:
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=wls/S-10511.htm
    but resolution does not work for me.
    I have created a mimemappings.properties file in BEA directory BEA\user_projects\domains\myDomain\config\mimemappings.properties with following content:
    htm=text/html
    gif=image/gif
    jpg=image/jpeg
    htc=text/plain
    png=image/png
    CSS file:
    .calendarClass {behavior:url(calendar.htc)}
    Web.xml:
    <mime-mapping>
    <extension>htc</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    I also tried htc=text/x-component.
    Stop / Start of server, Redeploy of War, this does not work.
    Any idea ?

    Thanks Ben!
    That helped. I also was using that
    from the examples, and it did not play well in the HTMLPanel.
    I appreciate the quick assistance, as I am pretty new to Spry. I have been creating version 2 of my website code, and one of the conversions has beenfrom JQuery to Spry for almost everything. Spry is a lot easier to conceptualize, except I completely missed the setting you gave me.
    One of my problems is lack of knowledge on how to see what is happening, or not ahppening with javascript on a page.  I have firebug, and that seems to give me some info.  But when I tried to look at stuff with scripts running on the HTMLPanel, I was unable to see anything.
    Thanks again,
    Jamie

  • Iif() sql statement is not working please help. An expression of non boolean type specified the context

    the following sql is not working . If  sum(salary) = null   should be displayed  1 or 0
    select empname,iif((isnull(sum(salary),0)),1,0) from salary group by empname
    regards
    Pol
    polachan

    I think what you're looking at is this
    select e.empname,
    COALESCE(s.totalsal,0) as salary
    from employee e
    left join (select empname,sum(salary) as totalsal
    from salary
    group by empname
    )s
    on s.empname = e.empname
    where employee represents your master table containing employee information
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Error while deploying a web service whose return type is java.util.Date

    Hi I have written a simple web service which takes in a date input (java.util.Date) and returns the same date back to the client. public interface Ping extends Remote * A simple method that pings the server to test the webservice. * It sends a dateti

  • Looking for a copy of iPhoto 2.0.1 UPDATE...

    Looking for a copy of iPhoto 2.0.1 UPDATE... can't find it anywhere?

  • Mapping issue in Data Services

    Hello, Experts! I'm just starting to learn DS. Can anybody help me with the following question: I have a table, for example: id  Curr value 1  USD  100 2  JPY  200 3  USD  300 4  JPY  400 5  EUR  500 And the issue is to map it so as to check the cond

  • Gr exchange rate

    Dear All, PO in USD which is a foreign currency. May I know what rate that during GR is using to calculate the amount in local currency? The day that do GR or the rate which updated in PO header delivery/invoice tab. Exchange rate fixed is NOT ticked

  • TITLE 3D in Final Cut 6

    Does anyone know how to reconnect Boris Title 3D in Final Cut 6? I haven't found any of the current topics applicable. Thanks!