Applescript and insert names without extension (Mail)

Hi,
my script does the following when i drop a video file on this app:
1. transcode it to ogg
2. copy the name and insert it in a newly created mail in the Subject and Message with "NameOfFile"
It is nearly perfect but it copies the file extension in the new mail, too.
How do i get the app to insert only the name without the Extension??
Best Regards
Lysard
on open of droppedFiles
          tell application "Finder"
                    set NameOfFile to name of item (item 1 of droppedFiles as alias)
          end tell
          repeat with nextDroppedFile in droppedFiles
                    set videoname to POSIX path of nextDroppedFile
                    if videoname contains "." then
                              set oldDelims to AppleScript's text item delimiters
                              set AppleScript's text item delimiters to {"."}
                              set videooutput to text 1 thru text item -2 of videoname
                              set AppleScript's text item delimiters to oldDelims
                    end if
                    set SettingPfad to POSIX path of (path to me)
                    tell application "Terminal"
                              do script ("ffmpeg2theora " & quoted form of videoname & " -f 30 -x 720 -y404 -V1500 -A 128 --two-pass -o " & quoted form of videooutput & "_XYZ.ogv")
                    end tell
                    tell application "Mail"
                              set theSubject to "Anlieferung " & NameOfFile & " _XXX"
                              set theContent to "Hallo,
" & NameOfFile & " ist availible here:
xxx
BR
ME"
                              set theAddress to "[email protected]"
                              set theSignatureName to "Signatur 1"
                              set msg to make new outgoing message with properties {sender:"[email protected]", subject:theSubject, content:theContent, visible:true}
                              tell msg to make new to recipient at end of every to recipient with properties {address:theAddress}
  --tell msg to make new attachment with properties {file name:theAttachmentFile as alias}
                              set message signature of msg to signature theSignatureName
                    end tell
          end repeat
end open

There are a couple of points in your original script that should be addressed.
One you are dropping files on the script and sending them out as mail messages but because you are setting the filename before you actually loop through the dropped files all mail messages will have the same filename. You should move
tell application "Finder"
                    set NameOfFile to name of item (item 1 of droppedFiles as alias)
          end tell
Inside the repeat to get the actual filename in each mail message.
Then this
if videoname contains "." then
             set oldDelims to AppleScript's text item delimiters
             set AppleScript's text item delimiters to {"."}
             set videooutput to text 1 thru text item -2 of videoname
             set AppleScript's text item delimiters to oldDelims
end if
While it works is defeating the whole point of setting the text item delimiter.
Once you do
set AppleScript's text item delimiters to {"."}
then text item 1 of videoname is the filename and text item 2 is the extension ie:
set videooutput to text item 1 of videoname
will get the name of the file into videooutput
In fact you could just use videooutput as the name in the mail message.
regards

Similar Messages

  • Photos on SD card missing after removing and inserting card without umount

    Hi!
    I am running Tiger 10.4.11 on my old Powerbook G4 12inch. I am hoping to get some help on an issue which resulted in some photos "disappearing" from an SD card. The story goes as follows:
    On day 1 I plugged in the SD card using a USB card reader to my Powerbook. The SD card mounted correctly and I could see my photos (~100). I then closed the Powerbook without ejecting or umounting the SD card. The Powerbook went to sleep and I then unplugged the SD Card.
    The next day I then went and took another ~30 photos with my camera using the same SD card. I could see that I had ~130 photos using my camera's built-in viewer.
    I opened my Powerbook and it came out from sleep. I then inserted the SD card into the USD adapter again. The funny thing is that the Powerbook only showed the ~100 original photos still. I then tried to eject the SD card but MacOS showed an error saying that the volume is in use so can not be umounted. I then unplugged my SD card.
    Following this I can no longer see the ~30 photos on my camera's display either. I have also tried various file recovery programs on Mac OS 10.4, 10.6 and Vista, none show the ~30 "missing" photos. I have also tried to look for any hidden files using terminal with "ls -al" in all the directories but with no luck. The trash can also is empty.
    I am guessing that by not umounting the SD card and then inserting it again the OS was still using old FAT tables or something along those lines (speculating here). The question is, any chance of recovery or any other strategies you can suggest to help?
    Thank you very much in advance and best wishes.
    Oyvind

    You may have been able to try and use Disk Utility to repair file damage on
    the SD card's storage; but the actual damage due to improper unmounting
    in the first instance is carried over to the last. So corruption of them is likely.
    There may be some third party utility for helping restore or recover data
    from these camera flash memory cards, that may help. Sometimes, it
    may be possible to see if the OS X Disk Utility can try to fix the files, but
    that may also change them or make them unrecoverable by another kind
    of utility. While I don't have experience recovering lost or erased images
    from camera memory cards, I do know such software utilities for just this
    purpose do exist. Initially, a few years ago, I noticed a freeware utility was
    offered as well as a few shareware downloads that would work, for a fee.
    Maybe that is the direction to check into, and see if you can repair and
    recover the images which were subject to damage or corruption due to
    the improper unmounting and remounting of the SD. These items act
    just like any external hard disk drive, and need to be handled the same.
    Good luck & happy computing!

  • Applescript and voice control without SpeecchRecognitionServer

    Hi, I want to make a voice controled applescript, but without SpeechRecognitionServer. What should I do?

    I have been running Siri on my apple iPhone with Verizon I got in April 2011.
    It has been GREAT!
    Just about a few days ago, this program "Siri" has added the following text that shows up as soon as you start the program...
    "I've been replaced! The new Siri is even smarter and better-looking than me, and waiting for you on iPhone 4s. I'll be leaving for home on Oct 15th."
    "Until then... how can I help you?"
    My question is...
    How can Apple take away my current program on my current iPhone BEFORE the iPhone 4s.
    I am NOT going to buy the new iPhone, since I have had my current iPhone for less than a year!
    I will REALLY get MAD at Apple if my current iPhone will lose the original Siri!

  • Dynamic File and Directory Name without Mapping

    Hello Experts,
    We have following requirement:
    1) Files will be picked from R/3 AL11 directory and would be placed in corresponding folder in target system.
    2) On source side ,there would be only one folder for all types of files(around 20),but on target side,there would be one folder for each kind of file(20 folders)
    3) File name should be same on the target side but target directory should be selected based on file name.
    I have gone through a number of posts related to similar requirements and hence,sorry for a new post but I am not yet able to find a solution to this.
    I could understand,this can be achieved using DynamicConfiguration UDF .
    But I have no possibility to have mapping in my scenario.It would just be a pass through scenario.
    Can anyone please suggest a solution to this?
    Thanks.
    Regards,
    Shweta

    Hello,
    Thanks a lot for suggesting solution to this problem.
    I could achieve this using following Java mapping:
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class GetDynamicConfiguration implements StreamTransformation {
        private Map param;
        public void setParameter(Map map1) {
            this.param = map1;
        public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
            try {
                   AbstractTrace  trace = null;
                // a) Set ouput File name
                String directory=null;
                   trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
                param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
                DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
                   DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
                String filename =conf.get(key);
                conf.put(key, filename);
                   trace.addInfo("File name is "+filename);
                if(filename.equals("in.txt"))
                directory = "/home/ftpxi/in";
                   if(filename.equals("test.txt"))
                   directory = "/home/ftpxi/in/test";
                   if(filename.equals("shweta27.txt"))
                   directory = "/home/ftpxi/in/test";
                   trace.addInfo("Directory name is "+directory);
                   conf.put(key1, directory);
                // b) Just copy input file to output file
                byte[] b = new byte[inputstream.available()];
                inputstream.read(b);
                outputstream.write(b);
            } catch (Exception exception) {
                exception.printStackTrace();
    Thanks again.
    Regards,
    Shweta

  • Flatfile output mask with source file name without extension

    I have an input file with name abcdefgh.xml. This is converted to flatfile output, but I want the flatfile output name to be
    abcdefgh.
    If I use the %SourceFileName%, I am getting the output filename as abcdefgh.xml, I want it to be abcdefgh

    Hi
    %SourceFileName% Macro gives the file name along with extention.
    so if you want to remove extension then either you can do it in orchestration with expression Shape
    msgOut(FILE.ReceivedFileName) = System.IO.Path.GetFileNameWithoutExtension(msgIn(FILE.ReceivedFileName))
    another way , you can write the custom pipeline component .

  • Internal and Public DNS conflict breaks mail

    History:
    We set up a new Mac Mini Server to replace our existing Server. The Mac Mini Server is setup behind a Time Capsule, which acts as our router and DHCP server. It also acts as our firewall on the public IP address and forwards mail to our internal server. Our situation is almost identical to the example situation on page 18 to 19 in the 'Getting Started' guide.
    Our ISP acts as our DNS server and they host our public website. They also used to host our mail, but we have now moved the mail to our new in-house server. We asked our ISP to update their MX records to point to our static public IP address. Public DNS records for server.mydomain.com also resolve to this IP address.
    When we originally set up the new mac mini server, the ISP had not yet updated the MX records. I am wondering if this affects how the Server sets up DNS on the local server machine?
    Issue:
    The local server machine on the local LAN is called server.mydomain.com, which resolves via local DNS (hosted by our server) to the server's internal IP address. (The local DNS server was setup automatically by the Server during initial installation / setup.) This conflicts with with public DNS records which identify server.mydomain.com with our public IP address at 205.200.19.225. This somehow causes confusion for the server which consequently seemingly randomly resets our domain (mydomain.com) and host name (server.mydomain.com) settings under Mail settings - which breaks our mail service. (We then edit these to the correct settings and all works again.)
    I spoke to an Apple tech and they advised that we reinstall the Server operating system, using a local server name that differs from the public name. e.g. server.mydomain.lan (local) vs. server.mydomain.com (public).
    *This may seem like a dumb question*: Would it be easier to keep our local host and DNS set up to server.mydomain.com and then rather have our ISP change the records for our public address / IP to mail.mydomain.com or public.mydomain.com? If we could make the change via the ISP's records versus our own, then it would save us a lot of work.
    *A second potentially dumb question:* Since we rely on our ISP for DNS name servers, could we delete / stop the local DNS server for the local network and just use straight IP addresses instead?
    *Plan of Action:*
    Assuming that there is not an easy fix via the ISP's DNS records, then I'll reinstall the operating system and use server.mydomain.lan as the local machine and domain name. If I do this, then what should I be using as the domain and host name settings in mail? .com or .lan?
    Should there be any need to manually configure DNS settings to make Mail work?

    Mr Hoffman and Corbywan - thanks for the interesting and educational discussion. I must admit that I am still a bit confused and would appreciate any further help in understanding this issue!
    *My situation:*
    - Server on a LAN, which sits behind a Time Capsule router.
    - The Time Capsule router serves DHCP and Internet to the LAN and sits on our public static IP Address.
    - Our ISP has set up MX and domain records to forward public requests for our domain to our static IP address.
    - Time Capsule acts as our firewall and forwards Mail and other incoming services to our internal server via port forwarding.
    - Local DNS service is provided by the local server so that it can provide services to the local network. Non local requests are forwarded to the ISP DNS service.
    *The problem*
    We seem to have established that Snow Leopard Server breaks when the internal domain name matches the public domain name, because of conflict between the internal and public DNS which resolve to different IP addresses for the same domain.
    *The solution*
    I am looking for the easiest and most basic way to fix this problem. My understanding is that the simplest would be to reinstall our Snow Leopard Server to a new and different local domain name.
    I am thinking of using server.example.lan for our local LAN domain name - which would be resolved to our private IP address via local DNS on the local server. I would be keeping server.example.com for our public domain name - which would be resolved to our public IP address, which would be forwarded from the Time Capsule to the internal server.
    Now where I start getting confused is this: If Snow Leopard Server requires a Fully Qualified Domain Name to do things like send mail, then do I need to register my internal domain name? And how would this resolve from a public DNS server to the internal private IP address? Or is it more an issue where as long as the internal (albeit 'fake') domain name does not conflict with an existing public domain name?
    *Other items:*
    After setup, I will verify that Snow Leopard Server has setup our local DNS correctly for local DNS service.
    If I understand correctly, I would set up Mail Settings - 'Domain Name' as the local domain name: i.e. example.lan and I would set up the Host Name as server.example.lan - is this correct? Would this work if these are not FQDN?
    How does the mail server reconcile these local domain names with the public domain names? I assume that I need to check the box at Mail - Settings - Advanced - Hosting: "Include server's domain as local host alias" ? Or would I manually add an alias to the Local Host Aliases under the same tab?
    Thanks!

  • If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and gi

    If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and give the extension name is plz tell me the way that office files are compatible with it.
    == This happened ==
    Every time Firefox opened
    == when i download the office files

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • IWeb Applescript and Automator - scripts you shouldn't be without

    Applescript and automator will automate mundane manual repetative task that seem to take forever. These scripts fill in iWeb's void that makes it hard to implement advance features such one click ftp publishing, code editing, swithching domain site files, etc. Don't miss out on these scripts that will save you ton of time. These are scripts you shouldn't be without.
    Work smarter not harder with iWeb applescript, only from MacEzzy.
    -- Also check out the free downloadable iWeb templates.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

    Thank you for your feedback.
    -- Article never mentions compressed or uncompressed. Traditionally tiff format is used for buttons and small images on web pages and jpeg is used for higher quality photos exemplified by iWeb.
    -- Search engine spiders or crawlers start from top of the page to the bottom of html pages. They craw for topic as well as content. This is exactly what appears from iWeb html pages for meta (meta name="Generator" content="iWeb 1.0.1")
    -- I am the first to admit I don't know everything but I don't make up information. I use iWeb on a daily bases and try new things to push the envelope. Things that I find helpful to me I make it available for other iWeb community users so that they don't go through tribulation.
    -- I put google ads and paypal donate buttons throughout the pages to test if iWeb is up for commercial challenge. I also tested how well the search and replace script worked. I have exemplified in macezzy website it is possible to use iWeb for business purpose. The script worked extremely well, it would have taken hours to insert google and paypal codes manually. Using the script it only took 10 min. I wanted to share that with other users who might wanted to do similar things. Sorry if that offend you, I will remove them.
    -- I never claimed to have created the script except the script that makes the first folder in documents folder. I did change the wording so that it is clear to users that they are switching sites(domain file). I did not create the awesome search and replace script either. I do mention that I have made the iWeb_ftpUpload automator.
    I have started macezzy site when iWeb was introduced and there wasn't much information about iWeb. I have and do try many things with iWeb and report to iWeb community users of things that I find helpful. I haven't made a dollar off the site and I have invested lot of my time because I like to see other users succeed.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

  • Mail Receiver adapter - dynamic file name without mail package

    I know that we can get the dynamic attachment name using mail package... As per the FAQ Mail adapter, the Mail package use is deprecated and hence we do not want to go that route.
    I have seen the following wiki entry for setting the file attachment name...
    http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
    Is this the only approach to dynamic attachment name using Mail adapter (and without Mail package). Or a different approach without Adapter module is possible?

    There is a different approach without using mail package or adapter module.
    Have a look at this Wiki:
    http://wiki.sdn.sap.com/wiki/display/ESOAInfrastructure/Dynamic+Email+Attachment+name+for+Received+Mails+with+ASMA+and+without+using+mail+package

  • Is it possible to create an action to copy channel name text and insert into channel in CS5?

    I am a screen printer and I print my separations from Photoshop. I routinely work with multi channel files or RGB files with additional spot color channels. I have created actions to place my registration marks, re-size images, etc to get ready to print but I manually have to create the text labels for each screen if they are missing from the original artwork.
    The files I work with have channels named as "Base White, Red, Green, 284 Blue" etc indicating the ink color. What i would like to be able to do is click an action that would copy the text from the channel name and insert it into a separate or each/all channels near the top of the file so that when I print each positive it has a corresponding label for ink color.
    I am not sure if this is even possible, and I am limited on my knowledge when it comes to actions and have pretty much got lucky in the past getting them to do what I want without unnecessary steps.
    On my registration target action it creates a new channel with each individual reg mark then combines them into one separate channel in which I just copy the contents and select all the ink channels and fill with black to make them appear, i'm happy with the steps it takes as it isn't too much trouble and if this could do the same with labels I would be happy with that.
    Thanks in advance!

    What i would like to be able to do is click an action that would copy the text from the channel name and insert it into a separate or each/all channels near the top of the file so that when I print each positive it has a corresponding label for ink color.
    Actions are, as far as I can tell, plainly incapable of this, Scripts on the other hand are not.
    So you could try asking for help over at
    http://forums.adobe.com/community/photoshop/photoshop_scripting?view=discussions
    or
    http://ps-scripts.com/bb/viewforum.php?f=9&sid=353cb093927c497650e802701e6fff40

  • Can't forward e mail is say's contact error and no names show up

    since downloading the 9.0 firefox I have not been able to forward
    e mail, it say's contact error and no names show up, this is very
    upsetting since I e mail that is important to forward.

    Oops, our posts crossed. The two main changes in Safe Mode would be: (1) disabling Firefox's use of hardware graphics acceleration, and (2) disabling all extensions. You can try to implement those manually in regular mode.
    '''(1) Hardware Acceleration'''
    Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches with various display drivers.
    You usually need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    orange Firefox button (or Tools menu) > Options > Advanced
    On the "General" mini-tab, uncheck the box for "Use hardware acceleration when available"
    If you restart Firefox, are any issues improved? I suggest keeping it disabled even if you do not see an immediate benefit.
    '''(2) Extensions'''
    Disable ALL nonessential and/or unrecognized extensions. If in doubt, disable:
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    Then restart Firefox and test again.

  • How to make previous version documents(CS1 and CS3) without extension  readable in InDesign CS5

    I have some previous version documents of CS1 and CS3  on Mac  which have been saved without any extension e.g 300, CS3doc etc.
    When I open such documents in InDesign CS5 they appear to be unreadable .  Only on  selecting 'All documents' filter  I am able to open those documents.
    I want to make all such documents (which are without extension) readable with 'All Readable Documents ' also .
    How I can do that, please  help me !!!!!

    The first thing I'd do is make sure the issue is really what I suspect it is - i.e. I suspect your extension-less documents don't have the proper type and creator.
    If you fire up a Terminal window, you should be able to use the GetFileInfo command to check one of the files:
    Assume 'sampleFile' is sitting on your desktop, you'd do
    GetFileInfo ~/Desktop/sampleFile
    (not sure when/whether GetFileInfo is installed on a Mac - I think it used to be part of Apple's developer tools, but on my Snow Leopard it resides in /usr/bin)
    Check what it says for 'type' and 'creator'.
    If these are not correct, we've confirmed that that's the reason why they don't show up in your file dialog.
    If the issue is type/creator related, I can think of the following options:
    a) Change your code to accept ANY file type/extension - I suspect this would work (not tested!):
    openFileDialog->AddType( '????' );
    If memory serves right, '????' should be accepted as a wildcard.
    b) correct the file types BEFORE they are viewed in the File Dialog - for example, if these files are in a very specific folder somewhere, you might be able to scan the folder, and correct their type and creator (e.g. iterate through all extensionless files in folder 'xyz' and change their type and creator). A lot depends on how those files get there, and whether they are tied to a specific folder or not - are they 'old' files, or are they being generated in some workflow? If they're all over a user's system or all over a file server, such pre-scanning and cleaning up file types approach will be a no-go.
    Cheers,
    Kris

  • How to insert data into datagrid dynamically and also programatically with data and column names being retrived from a xml file..

    iam not able to insert data into datagrid corresponding to the column names..as iam inserting both data and column names programatically..ie iam not able to co relate the data with the column names.plzzz help me asap

    A DataGrid is row-based rather than cell-based with each row
    corresponding to an item in an underlying collection (specified in the
    dataProvider property). In order to add data to a DataGrid you
    manipulate the underlying collection, rather than the grid directly.
    Based on the limited description of your problem I would imagine you
    would need to create dynamic objects with property names that correspond
    to the dataFields of your dynamically created datagrid columns.
    So if you had created columns with dataFields "alpha", "beta" and
    "gamma" on your datagrid, you could create an item in your grid by
    adding the following object to your dataProvider:
    var gridItem : Object = new Object();
    gridItem.alpha = "alphaValue";
    gridItem.beta = "betaValue";
    gridItem.gamma = "gammaValue";

  • My brother-in-law recently passed away. My sister gave his MacBook Pro to my niece. When she opens and starts the laptop, it shows my brother-in-laws name. Is there a way to change his name to her name without formatting the device and starting over?

    My brother-in-law recently passed away. My sister gave his MacBook Pro to my niece. When she opens and starts the laptop, it shows my brother-in-laws name. Is there a way to change his name to her name without formatting the device and starting over?

    BigTex415,
    my condolences for your family’s loss. If all she seeks to do is to change the display name, and she’s willing to leave the account name unchanged, then she could do the following: log in as the administrative user and open the Users & Groups pane of System Preferences. If the padlock in the lower-left corner is locked, unlock it. Select the account that shows your brother-in-law’s name on the left-hand side of the window, and then on the right-hand side, change the text in the “Full name” textbox to her preferred display name. If desired, click on the padlock in the lower-left corner to relock it.

  • Incorrect sender name, subject, and photo being displayed in Mail

    For many of my emails, the wrong persons name, photo and subject are being displayed for emails.
    Anyone have this happen to them? And does anyone know how to resolve it? We've tried reinstalling the software.

    I get something very similar.
    I send an email message and it goes to the correct recipient, and the long header says it goes to the correct recipient. However, the one line header in the mail window showing me all my mail says it has gone to someone else. It seems to happen randomly, and the name seems to be a random name from my address book. It does not happen to all my mail (maybe one message in 50).
    It gives me a heart attack every-time because I think I have made a mistake.
    Dave

Maybe you are looking for

  • How can i make a suggestion for a new IOS

    Hello everybody y would like to know if i can make any suggestion for a new IOS cause there is some new things y would like it to have.Thanks.

  • I would like to automate the installation of FireFox to an alternate directory.

    I am trying to automate the installation of FireFox to my servers drive "F:" but I have not found a way to script this option. Typical Windows installations would use the INSTALLDIR= option, but this does not work. I have seen several different spins

  • Need help on DECODE query

    Hi Experts, Please help me on the below requirement. I have a table STUDENT with the following data. sid s_code 1    50     2    50 3    C 4    A 4    40 5    70 5    90 6    70I have a table MASTER with the following data. stud_code STUD_ABB_CODE 40

  • Problem with Email Submit Button in  Interactive Form

    Hi All, I am using EMail Submit Button in InteractiveForm. At run time when i click on this button then it is sending this pdf file in the form of .xml file at given Email address but i want to send pdf format only. Can anyone help me how to solve th

  • Use of having attributes

    All, We have got some of the requirements and we are in the process of designing.So how should we go ahead in finding the attributes of  a particular object and what is the use of having these attributes instead we can directly use those info objects