Mail attachment: difference between script and app bundle?

Hiya Folks,
I am trying to make an application in Applescript that will receive a file, then create a new email (in Mail.app) with that file attached. I would prefer it to be an app, rather than a script when it's finished. I have a script that appears to work.
This simple script will put up a Choose File window asking for a file, then bring Mail to the front and create a new message, with the selected file attached (it won't send it). For debugging, I made a dialog box pop up showing the path to the file selected:
-- begin script
set OpenedFile to choose file
display dialog "OpenedFile: " & OpenedFile
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
tell newMessage
set visible to true
tell content
make new attachment with properties {file name:OpenedFile} at after the last paragraph
end tell
end tell
end tell
-- end script
So I tried to make that into an app onto which I could drag n drop a file, and have Mail make a new message with that file attached. Try saving this following script as an Application or an Application Bundle:
-- begin script
on open OpenedFile
display dialog "OpenedFile: " & OpenedFile
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
tell newMessage
set visible to true
tell content
make new attachment with properties {file name:OpenedFile} at after the last paragraph
end tell
end tell
end tell
end open
-- end script
Run the first script as a script, and it works as advertised. Drag a file onto the second script saved as an app, and the message is created, but no attachment.
Note that the path displayed in the pop-up is the same for both scripts.
Anybody know what I'm doing wrong?
Thanks for your help,
Drewstre

on open (dragged_items)
my handleFiles(draggeditems) -- Send selected items to custom handler.
end open
on handleFiles(localItems)
tell application "Mail" -- Use terms of 'Mail'
activate -- Launch 'Mail'.
-- Add text to 'Subject' and 'Message' fields.
set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
tell newMessage -- Set focus to 'newMessage'
set visible to true -- Make message visible.
repeat with i in local_Items -- Cycle through the dragged items, adding each to new message.
tell content to make new attachment with properties {file name:i} at after the last paragraph
end repeat
end tell
end tell
end handle_Files
  Mac OS X (10.4.4)  

Similar Messages

  • Difference  between  scripts and  idocs

    In real time  why we are  using scripts and idocs?what is the difference between scripts and idocs?pls tell me  where we r using  scripts and  idocs?

    Hi,
    IDocs are simple ASCII data streams. When they are stored to a disk file, the IDocs are simple flat files with lines of text, where the lines are structured into data fields. The typical structured file has records, each record starting with a leading string that identifies the record type. Their specification is stored in the data dictionary.
    Electronic Interchange Document
    IDocs is the acronym for Interchange Document. This  indicates a set of (electronic) information which builds a logical entity. An IDoc is e.g. all the data of a single customer in your customer master data file, or the IDoc is all the data of a single invoice.
    Data Is transmitted in ASCII format, i.e. human readable form
    IDoc data is usually exchanged between systems and partners that are completely independent. Therefore, the data should be transmitted in a format that can easily be corrected by the computer operators. It is therefore mandatory to post the data in a human readable form.
    Nowadays, this means that data is coded in ASCII format, including numbers which are sent as a string of figures 0 to 9. Such data can easily be read with any text editor on any computer, be it a PC, Macintosh, UNIX System, S/390 or any internet browser.
    IDocs exchange messages
    The information which is exchanged by IDocs is called a message and the IDoc is the physical representation of such a message. The name “messages” for the information sent via IDocs is used in the same ways as other EDI standards. .
    Scrpits...
    If the user wants to print documents such as invoices, purchase order, all such documents are printed with the use of forms. SAP allows the user to define these forms by using layout sets. SAP script is the tool used to create the layout set.
    In order to print the document, the SAP system runs a program that collects the data for the document and feeds it into the layout set. This is called as Print Program.
    SAP Provides a standard layout set for every printable document and usually there is no need to create layout sets as such. User just modifies the existing layout sets as per requirement of client.
    Regards,
    Sam

  • Difference between scripts and smartforms

    Dear Experts,
    I require a same example or tutorials for scripts and smartforms, to know its exact difference. can any one provide me with that.
    Regards,
    CHK

    Hi,
    SAPscript technology is based on a mainframe product from the 1980s, while Smart Forms have only been around since (roughly) 2001. With that sort of time gap, there are bound to be significant differences between the two tools. Client dependence is a fundamental one. Although SAPscript has had some incremental improvements over time, its forms have always been -- under the hood -- relatively ...
    1. script is client dependent one while smartform is client independent.
    2. In scripts we have to write print program while in smart forms it is not necessary.
    3. In scripts we can print background logo while in smartforms we cant print background logo
    4. In scripts we have 99 main windows while in smartforms we have only 1 main window.
    5. In scripts we should write paragraph format otherwise we cant execute program while in smartforms no need to create paragraph formats .
    6. In scripts we can print the text in only two character formats.
    while in smartforms we can do with more.
    7. In scripts we dont have line types while in smartforms we have linetypes.
    the main diffarences between smart form and script form are:
    1) smart forms are clinent independent where as scripts are client dependent.
    2) smart form require half the time to create and maintain forms compare with
    script.
    3) smart forms provide multiple page formats where as in script not possible
    4) smart forms exisist without main window also where as in script not possible.
    5) smart form is entairely graphical user interface comapre with script.
    6) labeling is not possible in smart form where as it is possible in script.
    7) smart form genarate function module whenver it activate where as script
    doesn't genarate.
    8) smart form can easily web publishing using the genarated XML output compare
    with script.
    9) using smart forms we can design web forms but bot possible with script.
    10) we can maintain background graphics in smartform wher as in script not
    possible.
    11) in smart form we use transaction codes SMARTFORM for designing FORM
    and SMARTSTYLES to create differnt styles of text, where as in script we
    use SE71 for form painter and SE72 for different styles of text and font.
    12) we can migrate script to smart form vice-versa is not possible.
    Regards,
    Priyanka.

  • Difference betwwen script and smartforms

    plzzzzzzzzzz  difference between script and smartforms

    SAPscript technology is based on a mainframe product from the 1980s, while Smart Forms have only been around since (roughly) 2001. With that sort of time gap, there are bound to be significant differences between the two tools. Client dependence is a fundamental one. Although SAPscript has had some incremental improvements over time, its forms have always been -- under the hood -- relatively ...
    1. script is client dependent one while smartform is client independent.
    2. In scripts we have to write print program while in smart forms it is not necessary.
    3. In scripts we can print background logo while in smartforms we cant print background logo
    4. In scripts we have 99 main windows while in smartforms we have only 1 main window.
    5. In scripts we should write paragraph format otherwise we cant execute program while in smartforms no need to create paragraph formats .
    6. In scripts we can print the text in only two character formats.
    while in smartforms we can do with more.
    7. In scripts we dont have line types while in smartforms we have linetypes.
    also refer
    difference between smartforms and scripts
    Diff betwen Scripts & smartforms
    advantages of smartforms over scripts
    the main diffarences between smart form and script form are:
    1) smart forms are clinent independent where as scripts are client dependent.
    2) smart form require half the time to create and maintain forms compare with
    script.
    3) smart forms provide multiple page formats where as in script not possible
    4) smart forms exisist without main window also where as in script not possible.
    5) smart form is entairely graphical user interface comapre with script.
    6) labeling is not possible in smart form where as it is possible in script.
    7) smart form genarate function module whenver it activate where as script
    doesn't genarate.
    8) smart form can easily web publishing using the genarated XML output compare
    with script.
    9) using smart forms we can design web forms but bot possible with script.
    10) we can maintain background graphics in smartform wher as in script not
    possible.
    11) in smart form we use transaction codes SMARTFORM for designing FORM
    and SMARTSTYLES to create differnt styles of text, where as in script we
    use SE71 for form painter and SE72 for different styles of text and font.
    12) we can migrate script to smart form vice-versa is not possible.
    Thanks
    reward if useful
    Richa

  • What's the difference between PNG and JPG for exporting .idea files from the Adobe Ideas app?

    What's the difference between PNG and JPG for exporting .idea files from the Adobe Ideas app?
    What situations are better to export to to .PNG or .JPG?
    J

    iPad apps are designed specifically for the iPad and will not run on the iPhone or iPod Touch. iPhone/iPod apps will run on the iPad, but will only take up an iPhone sized portion of the iPad screen (though you get a 2x button which effectively doubles each pixel in both directions so may appear pixelated). There are also 'universal' apps (which have a '+' symbol against them in the store) which have processing in them to recognise the device that they are on and will tailor the display accordingly (so will make use of the iPad's larger screen).

  • Script logic: differences between MS and NW?

    Hi to all,
    at last SAP Tech Ed I've bought a book on SAP BPC 7, Netweaver version...I did it because I'm already working with the MS version, but I hoped to get a better vision on BPC over NW, and to understand some critical subjects.
    One question that I've been wondering is this one: I've found that some script logic examples that I've been able to reuse even in the MS version of BPC, while other won't. For example, I've found the *RUN_ALLOCATION (which I couldn't find in the logic assistent helper installed), and used it happily , and at the same time, I've found the *RUN_PROGRAM, which I don't really get any help from the web. I've found some posts in the NW version, not in the MS.
    So: is there any kind of document about the differences between scripting logic for MS and NW?
    Thank you
    Daniele

    Between 7.0 M and 7.0 NW we have a document with differences.
    But after that new SP or release was bringing new functionalities into NW.
    So it is depending what versions you will compare.
    Any way you will find key words into NW which are not into M version and oposite.
    So my suggestion will be to check the help documentation for version of NW used and to use the key words existing into that version.
    Principle of script logic is the same.
    Regards
    Sorin Radulescu

  • Difference between abort_exec_request and deactivate_execution scripts

    Does anybody can explain the difference between abort_exec_request and deactivate_execution scripts which come with OWB?
    The first one will "abort the job in a managed way" the other "deactivate it so that the job is Completed in a managed way". What does that exactly mean?
    Thanks in advance for some explanations!!

    Hi Tonguç,
    Your AQ have four subcriber. "State" column value chances* after all subscribers dequeue the message.
    On the other hand, you won't see this result because of retention parameter. if you don't set retention time, message deleted from queue after dequeueing.
    Look at "retention_time"
    ex :
    EXEC dbms_aqadm.alter_queue(
    queue_name => 'AQ_MARKETING_DATA_QUEUE',
    retention_time => dbms_aqadm.INFINITE);
    also you can set this parameter when creating your queue
    * i ignored failing cases, such as exception queue etc.

  • Difference between 'setup' and 'configuration' in Oracle Apps

    Hi,
    Thank in advance.
    I want to know Difference between 'setup' and 'configuration'(Oracle Apps ). Could you provide the details with an example, please?
    Regards,
    Raghavendra Rao

    Business Requirement:-
    ===============
    A company may want to allow all of its employees to make purchases up to $10 without having such purchases approved. Another company may have a business rule that each employee’s approval limit depends on his or her position within the organization.
    Question:-
    =======
    How to reach the above requirement?
    Is it thorugh configuration or setup?
    It must be through configuration and not set up.
    Set up is something like one time.. Configuration can be changed depends on your business needs.
    Like if your company wants to increases the limit from 10 to 100$, then change in configuration is needed.
    Hope you got the answer.. if you want more explanation, please be specific....

  • What is exact difference between table and template in script

    hello all
    what is exact difference between table and template in script

    Hi there.
    Tables alow you to achieve more complex flows with internal tables. You can use different types os lines, like footer, header, line items, and differente types of line items. Also, and most important, you have different processing blocks, again header block (processed before processing of first row), body block (rows) and footer block (after last row or page break).
    If you don't need any of this, use a template inside a loop to achieve something like a table. I personaly use templates only to draw lines, for example, before and after a loop, or to align some header in my documents.
    A table, is a loop and template mixed to become a very good tool.
    Regards.
    Valter Oliveira.
    Edited by: Valter Oliveira on Jun 5, 2008 5:10 PM

  • Difference between Workflow and Alert management

    HI all
    Let me know the difference between workflow and alert management. ?
    In Workflow if we  want to trigger alert or mail.
    We can use SO_NEW_DOCUMENT_SEND_API1 FM send mail.
    But in alert we can use different method?
    Can i know wht the exact difference between two?

    Hi,
    email messages can be sent with both technologies...
    If you need to send just a simple email, use the ALM.
    If you need to send email and wait something adding additional flows....use the Worflow.
    Remember that with ALM is not possible to attach something to the email.
    You can add additional steps like web addresses in order to perform further activities.
    Luciano

  • The difference between N80 and N80IE ?

    What is the difference between M80 and N80ie?

    02-Jan-2007
    07:45 PM
    korngear wrote:
    The Nokia N80 Internet Edition is a new version of this handset with the same hardware as the normal N80. It is due for release in Q4 of 2006 and will be available in Patina Bronze or Pearl Black, and has the following additional software included.
    Yahoo Go! for Mobile
    Flickr
    Some Amazon Branded Software
    'Download!' App management
    Internet Telephone - SIP VOIP Frontend
    WLAN Wizard
    Gizmo VOIP - Gizmo Project VOIP Frontend.
    \\en.wikipedia.org//
    @Korngear
    Thanks.
    Could N80 be upgraded to N80IE?

  • What is the difference between PUSH and FETCH

    I am a little confused. I use my iphone for both my personal POP email accounts and my business exchange account. I am trying to save as much battery as I can so I turned off push and set everything to manual...but now when I try and get may mail....it either says "connecting" or "checking for new mail" at the bottom of the screen and nothing happens from there.
    What is the best way to setup this situation for the most battery life? I don't need it to automatically download emails just when I open the email accout would be nice.
    I also noticed that when I delete an email from my iphone on my exchange account, it also deletes is on my desktop at work...I need to turn this off...is it possible?

    Hi maxum25,
    The difference between push and fetch is that:
    When using push, the server sends a signal to the iphone and lets it know that an email is coming its direction. Kind of like receiving a call. The iphone does not need to do anything except receive the email.
    When using fetch, the iphone has to wake up every so often and send a request to the server to see if there is any new email waiting for it on the server to download. This takes more time because the iphone sends a request, the server says yes there is some, the iphone says ok give me the new email.
    Now the exchange email uses active sync to keep all changes on the exchange server and mobile device in sync. This is automatic and is the nature of exchange and active sync. In order to keep this from happening you would need to talk to your IT dept. and see if they have an imap or pop alternative. Even using imap reflects the changes back to the server.
    Hope this helps.

  • What is the difference between start() and run()

    Hi:
    what is the difference between start() and the run()???
    in my app, i have
    Console.debug( "starting thread to listen for clients" );
    _server = new Server( this );
    _server.start();
    _server extends Thread..
    why everytime i use server.start(); my app will terminate on it is own, even though in my servr.run() method, i have a while loop
    and if i call _server.run() explicitly in my code, that while loop will be in execution
    can someone let me know??
    thnx

    what is the difference between start() and the
    run()???start() is a method on Thread that tells it to start.
    run() is a method in the object that the thread executes.
    why everytime i use _server.start(); my app will
    terminate on it is own, Err.... I'm not convinced this is true. It'll throw an IllegalThreadStateException, if you try to restart an existing thread.
    If that's what you're saying.
    even though in my _servr.run()
    method, i have a while loopI don't see the connection. Are you saying that the while loop never terminates, and you don't see why the thread is terminating?
    and if i call _server.run() explicitly in my code,
    that while loop will be in executionIf you call server.run() explicitly, then run() will be executed in the same thread that you called it in.

  • 1)Now I use Lightrom 5.7 how to upgrade to 6 or CC? 2) What is the difference between 6 and CC vercion? 3) When I used lightromm 3, I could see inEXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is ve

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    2) What is the difference between 6 and CC version?
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    Purchase the standalone upgrade from here: Products
    Download CC version from here: Explore Adobe desktop apps | Adobe Creative Cloud
    2) What is the difference between 6 and CC version?
    See this comparison chart: Compare Lightroom versions | Adobe Photoshop Lightroom CC
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?
    Rob Cole's ExifMeta plugin displays the Subject Distance field (and much more).  Unfortunately, his Web site appears to be down again.  He used to be very active here, but he hasn't posted in several months.

  • What is the difference between TO_CHAR and TO_DATE()?

    Hi everybody,
    i am facing a problem in my system.It is quite urgent, can you explain me "What is the difference between TO_CHAR and TO_DATE()?".
    According to user's requirement, they need to generate a code with format "YYMRRR".
    YY = year of current year
    M = month of current month (IF M >=10 'A' ,M >=11 'B' , M >=10 'C')
    RRR = sequence number
    Example: we have table USER(USER_ID , USER_NAME , USER_CODE)
    EX: SYSDATE = "05-29-2012" MM-DD-YYYY
    IF 10
    ROW USER_ID , USER_NAME , USER_CODE
    1- UID01 , AAAAA , 125001
    2- UID02 , AAAAA , 125002
    10- UID010 , AAAAA , 12A010
    This is the original Script code. But This script runs very well at my Local. Right format. But it just happens wrong format on production.
    12A010 (Right) => 11C010 (Wrong).
    SELECT TO_CHAR(SYSDATE, 'YY') || DECODE( TO_CHAR(SYSDATE, 'MM'),'01','1', '02','2', '03','3', '04','4', '05','5', '06','6', '07','7', '08','8','09','9', '10','A', '11','B', '12','C') ||     NVL(SUBSTR(MAX(USER_CODE), 4, 3), '000') USER_CODE FROM TVC_VSL_SCH                                                       
         WHERE TO_CHAR(SYSDATE,'YY') = SUBSTR(USER_CODE,0,2)                         
         AND TO_CHAR(SYSDATE,'MM') = DECODE(SUBSTR(USER_CODE,3,1),'1','01',          
              '2','02', '3','03', '4','04', '5','05',          
              '6','06', '7','07', '8','08', '9','09',          
              'A','10', 'B','11', 'C','12')                    
    I want to know "What is the difference between TO_CHAR and TO_DATE()?".

    try to use following select
    with t as
    (select TO_CHAR(SYSDATE, 'YY') ||
             DECODE(TO_CHAR(SYSDATE, 'MM'),
                    '01', '1',
                    '02', '2',
                    '03', '3',
                    '04', '4',
                    '05', '5',
                    '06', '6',
                    '07', '7',
                    '08', '8',
                    '09', '9',
                    '10', 'A',
                    '11', 'B',
                    '12', 'C') as code
        from dual)
    SELECT t.code || NVL(SUBSTR(MAX(USER_CODE), 4, 3), '000') USER_CODE
      FROM TVC_VSL_SCH
    WHERE SUBSTR(USER_CODE, 1, 3) = t.codeand yes you need check time on your prodaction server
    good luck
    Edited by: Galbarad on May 29, 2012 3:56 AM

Maybe you are looking for

  • Day 5 with no Itunes store

    Is there something I need to do? Can't open or purchase. If I remove and download a new Itunes program will I loose all that I've already purchased? Or do I just return all my I-stuff and contact consumer affairs?

  • HT4437 ipad 2 hdmi adapter to tv

    How come the screen mirroring does not work any more? All I can do is mirror movies, music and photos now. What is the good of having an ipad 2 if it only acts like the ipad 1 because of the update. It used to work before the update! NO WORD FROM APP

  • BAPI: Any bapi or RFC for f-28

    Hi all,         can any one tell me bapi or rfc available for t-code f-28        please help me... Regards, devika G.

  • Manager Self Service Team Calendar

    Hello, we've a Enterprise Portal 7.0 SP 12 running the Manager Self Services. Our backend is SAP ECC 6.0. When executing MSS - Team - Team Calendar the following error message is displayed: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException:

  • Activation Unsuccessful and waiting (iMessage and FaceTime) on an iPhone 4s.

    My iPhone 4s is fully up to date. I have had it around 6 months and generally has been good. Unfortunately today I could not send a picture through iMessage (I was at home using the wifi at the time), so i proceded to turn it off and back on again. T