Applescript button returned of list

Hi
Here is my script:
set firstList to {"Sincronizza proprietà avanzate", "Escludi proprietà avanzate"}
set listchoice1 to choose from list firstList with prompt "Le proprietà avanzate di una cartella sono l'icona della cartella, la posizione degli elementii al suo interno e l'icona delle cartelle al suo interno." with title "Fai una selezione" without multiple selections allowed
At the end of the list there are two buttons, "Ok" and "Cancel", if I select "Ok" it goes ahed, if I select "Cancel" it still goes ahed.
Instead I want that if the button "Cancel" is selected, regardless of the choice made, the application must close.
How can I do that?

Returend result from choose from list
Result
If the user clicks the OK button, returns a list of the chosen number and/or text items; if empty selection is allowed and nothing is selected, returns an empty list ({}). If the user clicks the Cancel button, returns false
So check to see if the result returned is false and if it is exit.
Something like (there are other ways to do this)
if listchoice1 is false then
     tell me to quit
end

Similar Messages

  • Applescript buttons returned from display dialog

    Hi!
    I have been learning Applescript for about a month and found the following issue which I thought was an easy implementation.
    On the "text returned" I get the error condition described. Do not understand!
    Any help would be appreciated.
    display dialog ("ENTER COMPANY NAME") with title ("TOTAL SHARE SPECIFICATION")
    buttons {"Cancel", "Company"} default button "Company" default answer ""
      set BUTTON_Returned to button returned of the result
      set CompanyName to text returned of the result
    error "Can’t get text returned of \"Company\"." number -1728 from text returned of "Company"
    MacBook 6.1     OS X Yosemite     Vn 10.10.1
    Script Editor  Vn. 2.7 (176)
    Applescript 2.4
    Regards

    No question that Applescript can be frustrating to learn. Many things about it have to be figured out by trial and error and when dealing with scripting applications all bets are off. The application designer can pretty much do as they want so what works in one app might not work in another even though you are using the same and correct applescript
    I find Introduction to AppleScript Language Guide by Apple to be a good source of answers and usually always have it open when I'm scripting  for quick reference.
    Spend some time getting familiar with the script editor. It is intelligent and can usually steer you in the right  direction when it comes to debugging.  Especially get use to and pay attention to the colors it assigns to items in your script.
    For example in your original script notice the colors of Button_Returned and CompanyName (your variables) and compare those to result and button returned. Also notice how text returned is a different color from button returned even though both are essentially the same thing. This is an indication that something is not right and it is where the error message occurred. (for a list of the default colors used open the Script Editors preferences and look at the Formatting tab).
    Notice  also how the editor formats your scripts, again the way the script gets formatted can tell you a lot if there is an error.
    Finally the error messages while cryptic can offer some clues. In your case the error message was
    error "Can’t get text returned of \"Company\"." number -1728 from text returned of "Company"
    generated by the line
    set CompanyName to text returned of the result
    The last part of the error message is essentially the line that caused the error after evaluation. So here result evaluated to “Company” which doesn't seem right, display dialog returns a record.
    Finally there is the log statement which will print its value to the log window
    Hope this helps
    regards

  • Display dialog, getting both text returned and button returned

    I am most of the way through my first major project in applescript. I want to get both the text returned of and the button returned of a dialog box. Is this possible?
    So basically i want to do the below without having the dialog box run twice.
    set thebutton to the button returned of (display dialog "Already Assigned!" & return & "Please assign a new letter" default answer "…" buttons {"Cancel", "Delete Previous Location for this Letter", "OK"} default button "OK")
    set theLetter to the text returned of (display dialog "Already Assigned!" & return & "Please assign a new letter" default answer "…" buttons {"Cancel", "Delete Previous Location for this Letter", "OK"} default button "OK")
    Rich

    Well thanks for the fast response, both work fine, cheers. That problem is now sorted.
    However while i was waiting for the responses i came across another problem, i would like to delete a specified item from a list. This is not the actual script but i was using it to test the syntax. So basically how would i go about deleting the the letter P from a list PQ
    set letterlist to {}
    display dialog letterlist as string
    set namep to "P"
    copy (namep) to end of letterlist
    set nameq to "Q"
    copy (nameq) to end of letterlist
    display dialog letterlist as string
    set theKeyPressed to "P"
    repeat with each_item in letterlist
    if each_item contains theKeyPressed then
    delete each_item
    end if
    end repeat
    display dialog letterlist as string
    Rich

  • Pl/sql web service returning a list of results

    I am able to publish a pl/sql package as a web service that returns a single result. However, when I try to return a list of results, I get an error in jdeveloper when I select the package and invoke publish as web service.
    I use a simple pl/sql package:
    create type longcredit_obj as object (
    credit varchar2(200),
    parlrepid number(6),
    mbrid number(6),
    rdgid number(6))
    create type longcredit_list as table of longcredit_obj
    create or replace package longcredit_pck as
    function get_longcredit (initials in varchar2) return longcredit_list;
    end longcredit_pck;
    create or replace package body longcredit_pck as
    function get_longcredit (
    initials in varchar2) return longcredit_list
    as
    i integer;
    list longcredit_list;
    cursor c_credit is
    select a.credit, a.parlrepid, a.mbrid, a.rdgid
    from member_credits_test_vw a
    where upper(init) = upper(initials);
    begin
    list := longcredit_list();
    for rec in c_credit
    loop
    i:= list.last;
    list(i) := longcredit_obj(null, null, null, null);
    list(i).credit := rec.credit;
    list(i).parlrepid := rec.parlrepid;
    list(i).mbrid := rec.mbrid;
    list(i).rdgid := rec.rdgid;
    end loop;
    return list;
    end get_longcredit;
    end longcredit_pck;
    Is this a feature that is available?
    Any suggestions are appreciated.
    Thank you in advance.
    Carmen.
    I am running jdeveloper 10.1.3.2.0 and database v. 10.1.0.4.0.

    Hi Steffen,
    I did manage to get it to work by doing the following:
    drop type longcredit_list
    drop type longcredit_obj
    create type longcredit_obj as object
    (credit varchar2(200),
    parlrepid number(6),
    mbrid number(6),
    rdgid number(6))
    create type longcredit_list as table of longcredit_obj
    create or replace package longcredit_pck as
    function get_longcredit(initials in varchar2) return longcredit_list;
    end longcredit_pck;
    create or replace package body longcredit_pck as
    function get_longcredit(initials in varchar2) return longcredit_list
    as
    v_longcredit_obj longcredit_obj:=longcredit_obj(null,null,null,null);
    v_longcredit_list longcredit_list:=longcredit_list();
    i number:=1;
    cursor getlist is
    select distinct a.credit, a.parlrepid, a.mbrid, a.rdgid
    from member_credits_test_vw a
    where upper(init) = upper(initials)
    order by a.parlrepid;
    begin
    for rec in getlist loop
    v_longcredit_obj.credit := rec.credit;
    v_longcredit_obj.parlrepid := rec.parlrepid;
    v_longcredit_obj.mbrid := rec.mbrid;
    v_longcredit_obj.rdgid := rec.rdgid;
    v_longcredit_list.extend;
    v_longcredit_list(i):=v_longcredit_obj;
    i:=i+1;
    end loop;
    return v_longcredit_list;
    end get_longcredit;
    end longcredit_pck;
    Also, before deploying, in jdeveloper, in the deploy file, I select the property filters under web-inf\classes and check all the classes that are unchecked (see thread id 505217).
    Also, the database I'm using now is v. 10.2.0.3.0.
    Thanks for your suggestion!
    Carmen.

  • Return multiple lists at once...

    Hi all,
    I was wondering if there was a good way to return two lists of strings at once. To my knowledge, theres no such thing as a list array. Is there a better way than adding two list objects to another list and returning the new list (which contains two lists of strings)? Thanks for any info.
    - Leon

    Another way, could be to pass one (or both) of the lists as method arguments.
    e.g....
    List list1 = new ArrayList();
    List list2 = new ArrayList();
    myMethod(list1, list2);
    public void myMethod(List list1, List list2) {
      if (list1 == null || list2 == null) return;
      list1.add(...);
      list1.add(...);
      list2.add(...);
    }You'll have to decide which way is suitable and if you do indeed need to
    return two Lists from your method.

  • How to enable enable Quick Edit button in Discussions List (SharePoint community).

    I wonder how I can enable the Quick Edit button in Discussions List (SharePoint community), see attachment. This is no problem on other list in SharePoint. I need to import data that I have in a Excel sheet from and old forum (not Sharepoint). So if I can
    enable Quick Edit, I will just copy data into my Discussions List. Hope somebody can help me???

    Hi,
    Please execute the commands below to enable Quick Edit feature in Discussion board list:
    $web = get-spweb "http://sp/sites/sitename"
    $list = $web.Lists["listname"]
    $list.DisableGridEditing = $false
    $list.Update()
    Now you could use Quick Edit in Management view.
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Bugreport: Apex 4.2.1 Button 'Return to application' doesn't return to app

    Hi there,
    I think there is a bug, when searching for a page number that doesn't exist in the application (e.g. typing error).
    When you edit a page and enter a page number where the page doesn't exist (that means in Field "go_to_page"), the error "Error processing condition. ORA-01403: no data found" appears correctly, but with button 'Return to application' you don't come back to the application.
    The same behavior is when you enter a non-existing page number in "Search Application" (P0_SEARCH) on the overview page of an application
    e.g. http://apex.oracle.com/pls/otn/
    WS: uBrennerDemo
    demo/demo
    Application: 61765 (Demo01)
    go to page: 5
    Regards Uli

    I get this a lot - it's frustrating!

  • How to return a list of class from a package

    Hi,
    I'm trying to create a RPG game with 50 characters. There will be a superclass, and each character is a subclass that extends from the superclass. Each will have unique abilities that will be functions. These classes will be thrown into a package.
    I would like to know the code for returning the list of classes in that package. That way, I can present them as a list for the player to choose just a handful of characters to start out with.
    Thanks in advance         

    Hi u can use the this class
    flash.utils.describeType;
    Regards
    Sumit Agrawal

  • How to add a button in a list uibb

    Hello Volks,
    I need help.
    I have to add a Button ( or just events to a button ) to a list uibb dynamically at runtime, which means I can't use the ~get-definition method.
    This means I have to do it in ~get-data. I can define my actions there and add them to ct_action_usage but I can't come up with a way
    to assign them to the button.
    Does anyone have any idea how that might work?
    Thanks in advance.
    Mike

    Hi Micheal,
    We can achieve the required functionality in get_data method. First,Create the button and assign it to concerned action ( initially defined in GET_DEFINITION method ) at UIBB configuration. Now in case if you want it hide it at start up ,& have to modify based on a event ,the  visible parameter of the CT_ACTION_USAGE can be used to achieve it.
    VISIBLE = CL_WD_UIELEMENT=>E_VISIBLE-NONE. " To hide the UI concerned to method
    VISIBLE = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE." TO show the UI concerned to the method.
    In your case , following code will help accordingly. I have changed the visibility of button based on a event, initially I have disable the button and based on certain event I have enabled it again.
    data ls_act_def like line of ET_ACTION_DEFINITION.
       ls_act_def-ENABLED = 'X'.
       ls_act_def-ID = 'ADD'.
       ls_act_def-TEXT = 'Add a row'.
       ls_act_def-VISIBLE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
       append LS_ACT_DEF to ET_ACTION_DEFINITION.
    endmethod.
    method IF_FPM_GUIBB_LIST~GET_DATA.
    IF IV_EVENTID->MV_EVENT_ID EQ  'FETCH_DATA'.
      field-SYMBOLS: <fs_field> like line of CT_ACTION_USAGE.
        loop at CT_ACTION_USAGE ASSIGNING <FS_FIELD>.
          case <FS_FIELD>-ID.
          when 'ADD'. " name of the field
              <FS_FIELD>-VISIBLE = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE.
                EV_ACTION_USAGE_CHANGED = ABAP_TRUE.
          ENDCASE.
          ENDLOOP.
    ENDIF.
    endmethod.
    Regards,
    Harsha

  • Button in basic list

    Hi
    I want to set a button in basic list of a transaction,not an ALV.
    I don't want to see the button in the detail list. How should i set this and where. Ideally where should  pf-status  be set in ?.
    Answers will be  rewarded.
    Thanks
    Varun Mathur
    Edited by: Varun Mathur on Feb 12, 2008 7:42 AM

    HI,
       check this program. in this the basic list has the gui and not the detail list...here the detail list is done using alv..dont worry abt that.
    report  z_banks1_rp1.
    TABLE
    tables : zacc_master2.
    TYPE-POOLS
    type-pools slis.
    *INTERNAL TABLE
    data : itab like zacc_master2 occurs 0 with header line.
    data : itab1 like zacc_master2 occurs 0 with header line.
    DATA
    data : gt_fcat type slis_t_fieldcat_alv,
           fcat like line of gt_fcat.
    data : check type c length 1,
           wa type c length 20.
    select * from zacc_master2 into table itab.
    write : '       ACCOUNT NUMBER' intensified color 3.
    loop at itab.
    write: / check as checkbox, itab-zaccno.
    endloop.
    hide : itab.
    START OF SELECTION
    start-of-selection.
    set pf-status 'ZMBANKS1'.
    AT LINE SELECTION
    at line-selection.
    AT USER-COMMAND
    at user-command.
    case sy-ucomm.
    when 'SUBMIT'.
    do.
    read line sy-index field value check itab-zaccno into wa.
    if sy-subrc <> 0.
    exit.
    elseif check = 'X'.
    read table itab with key zaccno = wa.
    if sy-subrc eq 0.
    move-corresponding itab to itab1.
    append itab1.
    endif.
    endif.
    enddo.
    CALLING SUB-ROUTINE
    perform fieldcatalog.
    CALLING FUNCTION MODULE
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    it_fieldcat = gt_fcat[]
    tables
    t_outtab = itab1.
    when 'BACK'.
    call screen 0002.
    *WHEN 'BACK1'.
    *CALL SCREEN 0002.
    endcase.
    SUB ROUTINE DECLARATION
    form fieldcatalog.
    fcat-seltext_l = 'ACCOUNT NUMBER'.
    fcat-fieldname = 'ZACCNO'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'CUSTOMER ID'.
    fcat-fieldname = 'ZCUSTID'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'ACCOUNT TYPE'.
    fcat-fieldname = 'ZACCTYPE'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'ACCOUNT BALANCE'.
    fcat-fieldname = 'ZBAL'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'ACCOUNT CREATED DATE'.
    fcat-fieldname = 'ZACCDATE'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    fcat-seltext_l = 'STATUS'.
    fcat-fieldname = 'ZSTAT'.
    fcat-tabname = 'ITAB1'.
    append fcat to gt_fcat.
    endform.
    Please reward if it is helpful.
    regards,
    sri

  • Add button in "Due List for Purchasing Documents" Screen

    Dear All,
    I need to add one button on "Due List for Purchasing Documents" Screen in customer view. Can you please suggest BADI for adding this button.
    Thanks

    Button to be added on toolbar.

  • I ordered the new Iphone 6 and it will ship on 10/31, on 10/15 I completed the paperwork to return my iphone 4 8GB, but it appears when my paperwork was emailed to me and I didn't notice until today.  It has my return phone listed as an iphone4 16GB...is

    I ordered the new Iphone 6 and it will ship on 10/31, on 10/15 I completed the paperwork to return my iphone 4 8GB, but it appears when my paperwork was emailed to me and I didn't notice until today.  It has my return phone listed as an iphone4 16GB...is this going to be an issue?  I was quoted a trade in value of $200 and need to apply this to my iphone 6, if the trade in is not going to be $200 I need to cancel.  I did call the verizon store today and the woman told me it should be no problem, but I keep hearing horror stories about this trade in program and I need to be sure.

    susan522,
    Congratulations on the purchase of your new iPhone 6. Ordering a new device can be very exciting and we understand wanting to be able to get your hand on it as soon as possible. With the trade in program the device that is being returned should indeed match what was selected at the time the trade in was processed. What we can have you do is reach out to our trade in team to see if this will cause any problems with the amount you receive once you turn in the iPhone 4. You can reach them here http://vz.to/1pJQcUb by clicking in the "How do I contact you" section. It will allow you to send an email to the team that handles the trade in requests personally.
    CandiceH_VZW
    Follow us on Twitter at @VZWSupport

  • Push Button on a list

    Hi ,
      How can we insert a push button in a list and control it operatins.
    Regards
    Arun

    I am not sure about this, but you can give it a try.
    Try
    SET PF-STATUS '<YOUR PF-STATUS>'
    and you can add buttons in the application toolbar. Have a gut feeling, it might work. Not sure though.
    Regards,
    Subramanian V.

  • Problem with Total Button with DroupDown list

    Hi All,
    here i have one Standard Report witch TCode is J3RFPDE . After Execute this program in output i get many button and in this button "TOTAL SIGN BUTTON"  has DroupDown list. So if i want thisTotal  Dropdown Button in my Report so is ti possible. And it's possible then please kindly tell me the procedure.
    Thanks
    Keyur Chauhan

    Hi,
    see report BCALV_GRID_05  it's a good exemple
    you must define class  METHOD handle_toolbar. 
    Rgds

  • Somehow the back button on my Safari browser got replaced with an autofill button; how do I get the back button returned to the toolbar?

    Somehow the back/forward button on my Safari browser got replaced with an autofill button; how do I get the back button returned to the toolbar and get rid of the autofill button

    Good to hear, Tom. Did you use "Customize" from the View Menu?

Maybe you are looking for

  • ORA-29913: error in executing  callout

    Hello, everybody I have some strange problem when I try to select data from an external table. The table has about 500'000 rows and select from it fetches about 200'000 rows normally and then throws the subj. message. ORA-299913 usually has name of t

  • Sold-to-party and Ship-to-party is disable

    Dear Expert, In SD IMG I assigned debit memo sales docs type into sales area to sales documents type.  Initial screen for VA01 it is okay. But showing in next screen sold-to-party and ship-to-party is disable. I can not select the customer. Please he

  • JS ScriptUI CS4: How to create an indeterminate progress bar?

    Hi Folks, Does anyone here know if ExtendScript (I'm using the CS4 flavor of ES) can produce an indeterminate (i.e., "barber pole") progress bar using ScriptUI's progressbar control? I've tried a number of value settings for the progress bar control

  • Classilla 9.3.1?

    next week i'm going to download classilla 9.3.1 to a g3 600mhz imac. i've never used classilla. in fact it's been more than two years since i've used the internet on this machine. before someone comments, i DO NOT watch videos on the internet. any ti

  • Cisco WLC with Bonjor services - MSE 3310 compatibility

    Hi All, We have a Cisco WLC 5508 currently running on code 7.2. We have Cisco MSE 3310 appliance (which is EoS & EoS) and it is running on code 7.2 as well. Now, we want to implement Bonjor Gateway services to support Apple Services such as Apple TV,