Shell Script- Force Quit Multiple Selections?

https://discussions.apple.com/message/25279344#25279344
Thanks to Red for providing this below as it works great for single applications, but if I throw in it multiple selections allowed
how can I separate each selection for force quitting? I'm a total newb to shell script with a decent skill level in applescripting. I'd love to see how this an be implemented.
set theItem to (choose from list theapps) as text
if theItem is false then error -128 -- or exit repeat (Cancel)
do shell script "killall " & quoted form of theItem

set theItems to ((choose from list theapps with multiple selections allowed) as list)
if (theItems as text) is "false" then
else if (theItems as text) is not "false" then
          set results to (every item of theItems)
          repeat with eachItem in results
                    do shell script "killall " & quoted form of (eachItem as text)
          end repeat
end if
TW actually after comparing it looks very similar! The reason why I used the false statement as text is I kept getting:
  --> false
end tell
tell current application
  do shell script "killall 'false'"
  --> error "No matching processes belonging to you were found" number 1
and it was my workaround that didn't return any error at all. Looking at it a bit more the false was returning that error because I had it "as list". Thanks again for helping me learn how to simplify the workflow some more!
Message was edited by: CyX SenZe

Similar Messages

  • Script to execute multiple select query

    Hi,
    What is the script to execute 5 ~ 15 select statement which will call pl sql functions simultaneously/concurrently and run it in sqlplus . I need to know the time taken by the queries to execute when there are multiple request calling the select statement.
    Thanks.

    I guess you can create 15 different shell scripts (on the server) which in turn call sqlplus and then call the 15 scripts in the background mode. Assuming your server is Unix, put an ampersand after your each shell script call to run in background.

  • Apple script force quit

    When i run an applescript it does it's job (runs a shell script) but then hangs up and i have to force quit it. Is there a shell script or apple script i could run to tell it to force quit without knowing the number of the running process? This is as i would like to not have to find out the process id number each time i run the script as it changes each time...
    thanks - 7;^')

    Post to the AppleScript forum under OS X Technologies. IIRC, you can add a quit to the script after some delay time.

  • How to i write a script that makes multiple selections in a pdf and exports them to excel?

    I have a large number of PDFs
    Not all the PDFs contain information we need. We want to be able to automate a script that extracts certain info from the PDFs and opens them in a certain format in excel.
    Acrobat allows me to make a single selection and export as excel.
    How do i export multiple parts to excel from the pdfs and ensure that the resulting excel is in a format that i can use without much fixing needed (e.g. merged cells)?

    This type of process can't really be done using JavaScript. You would need to read the contents of the file, word by word, decide (based on some logic) what data to extract, and then collect it and at the end export to a plain-text file. Not a simple process...

  • Power shell script to add multiple aliases with a .csv file.

    I have an email address lets say [email protected] and I need 1000 aliases added to the email. For example [email protected], [email protected] etc etc. and I have a .csv file with 990 columns with just project1, project2.
    Is there a way to run a command in powershell exchange to import all the aliases I need in a few commands? Can someone point me in the right direction if I am in the wrong forum also? Thanks
    No sure if this is correct or not:
    > $mbx = Get-Mailbox Project
    > Import-CSV "C:\SomePath\wherever.csv" | foreach { $mbx.EmailAddresses += $._SmtpAddress }
    > Set-Mailbox project -EmailAddresses $mbx.EmailAddresses

    Help Import-Csv -FULL
    $aliases=Import-Csv aliases.csv
    ¯\_(ツ)_/¯

  • Multiple select, update statements in one script

    Hi All,
    I wrote a script that has multiple select, update statements. When I ran the script in the sqlplus, I got error on second update statement:
    ORA-00936: missing expression
    Have any idea what was the problem?
    Thanks
    OF

    the following are my codes:
    set termout off
    set showmode off
    set timing off
    --set echo off
    set echo on
    set heading off
    set verify off
    set pagesize 0
    -- Parameters
    -- Transaction Date
    -- Show dates this format by default
    ALTER SESSION SET nls_date_format='DD-MON-YYYY';
    -- Define bind variables to hold report parameters
    var v_date varchar2(13)
    var v__run_date varchar2(13)
    begin
    -- Get job sumission variable for Transaction Date
    select gjbprun_value into :v_date
    from general.gjbprun
    where gjbprun_job = '&&1'
    and gjbprun_one_up_no = &&2
    AND gjbprun_number = '01' ;
    End;
    spool fwuodoc_&&2
    select FABINVH_CODE, FABINVH_POHD_CODE,
    FABINVH_INVOICE_DATE, FABINVH_PMT_DUE_DATE, FABINVH_TRANS_DATE,
    fabinvh_complete_ind
    from fabinvh
    where fabinvh_complete_ind='R'
    and trunc(FABINVH_TRANS_DATE) < trunc(to_date('&&dd_mon_yyyy','dd-mon-yyyy'))
    update fabinvh set
    fabinvh_trans_date=to_date('&&dd_mon_yyyy','dd-mon-yyyy')
    where fabinvh_complete_ind='R'
    and trunc(FABINVH_TRANS_DATE) < trunc(to_date('&&dd_mon_yyyy','dd-mon-yyyy'))
    update fpbreqh set
    fpbreqh_trans_date=to_date('&&dd_mon_yyyy','dd-mon-yyyy')
    where fpbreqh_complete_ind='Y'
    and nvl(fpbreqh_appr_ind,'x')<>'Y'
    spool off
    exit

  • Force quitting a "Mac Help" Window

    I was using Numbers on iWork 08 and I clicked the *"Mac Help"* on the main option bar. I typed a question and the Mac Help froze. I assumed that if I closed the Numbers application, that the Mac Help would then clear away. Apparently the problem was not within the Numbers Application, but simply just with Mac Help. I tried force quitting but when I open Force Quit to select Mac Help as one of the programs I quit, it isn't listed in the options. It still has the little Pinwheel showing the Mac Help is loading, and it's been that way for the past hour. It can manually move it around the screen, but it stays in front of whatever windows I have open. I cannot delete it, and the only way I can see it clearing from my screen would be to restart my computer. I do not want to do this, and I am just wondering if there is another way of *force quitting the Mac Help*.

    Try this:
    Open *Activity Monitor* in Applications>Utilities. Sort these by "Process Name." Find *Help Viewer*, then click the *Force Quit* button (looks like a stop sign). That should solve things!
    ~Lyssa

  • Power Shell Script for Check Remote machinces are live or not

    I have required a Power Shell Script for Check multiple Remote machines are live or not.Please guide me

    This will do it.
    http://gallery.technet.microsoft.com/Ping-IP-Adress-Range-d90ce82d
    &#175;\_(ツ)_/&#175;

  • On a web page when I open a pdf file it says download on the window and then suddenly starts opening multiple firefox blank pages I cant stop it except by using force quit - help

    multiple blank firefox pages open one after the other, can't stop them. only solution is to use "force quit" I am on an iMac. Never had this until today. Has happened now 3 times! its scary/
    == This happened ==
    Just once or twice
    == I clicked to open a pdf file on a web page (i've done this many times before on this web page with no problem) ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    See [[Firefox keeps opening many tabs or windows]]
    You can have infinite tabs opening if you have selected Firefox as the application to handle a file if you get an ''Open with'' download window.
    Firefox should not be selected as the application to handle a file and you have to remove the action that is associated with that file type.
    You can delete [http://kb.mozillazine.org/mimeTypes.rdf mimeTypes.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to reset all actions or set that action in Tools > Options > Applications to 'Always Ask'.
    See http://kb.mozillazine.org/File_types_and_download_actions ("File handling in Firefox 3 and SeaMonkey 2" and "Reset Download Actions")

  • How to do multiple shell scripts in AppleScript

    I got some solutions from previous posts on how to run sudo in Applescript, but there is still some minor syntax issues when I try to get to the destination directory. Usually in shell script I just type
    cd directory-destination
    in several lines to batch process those commands, but when I work with applescript, if I do do shell script for every "cd" command, instead of getting an overall result, I would get intermediate results individually.
    I read doc and learned that there might be a way to put commands together by using the & sign?
    Message was edited by: ttback

    An individual do shell script command runs in its own shell, so to perform multiple commands within that shell you need to combine them into a single statement. You can use the ampersand '&' operator to concatenate text strings, and the semicolon ';' to separate the commands, for example:set theFolder to "/Applications"
    do shell script "cd " & theFolder & "; ls -l ."See the technical note do shell script in AppleScript.

  • I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • Querying for a script insert multiple selected objects...

    Is there a script or plugin which insert multiple selected objects in one new text frame with one click?
    And is there a script or plugin which extract the content of anchored text frame out it's frame and replace it with it's frame. and extract selected text and insert it inside a new anchored text frame in it's place? (like convert text to table - convert table to text, but instead table we use text frame)

    Hi,
    Using OMB scripting to set attribute properties in a data mapping sort of defeats the purpose of utilizing a graphical user interface to define and set properties for a data mapping? Surely the GUI data mapping tool was created to get away from writing scripts and scripting would also require that you know the name of the data mapping, table operator and the set of attribute names for which you have to write one line of script to set each property value, i.e. 90 lines to set 90 attribute values.
    Cheers,
    Phil

  • How do I script a listbox so multiple selections can be recognized?

    I have a pdf project that lets the user make selections from a listbox, and then those selections determine which fields on the page are shown or hidden. I've made sure the listbox allows for multiple selections but I can't get the scripting to recognize and show multiple fields. So far it only works when one item is selected. How do I make it so when the user selects multiple entries that it will actually cause multiple fields to show?
    I've included file to show what I've gotten done so far.

    Sorry, realized my other posts question wasn't phrased very well and I figured you thought my question had been answered. So I posted it again with a better explanation of what I needed.
    Thanks for your help.
    Aaron

  • How do I prevent multiples of the same page downloading without a force quit?

    When I click on a link to download, Firefox 3.6.17 starts trying to download the page quickly over and over without success increasing in speed. I must do a force quite to stop this repetitive action as the many pages build up on my screen. This doesn't happen if I try it with Safari. I have FireFox for the MacBook. My laptop is 3 yrs old.
    Thanks in advance!

    Sounds that you have selected the Firefox application for a file type that it doesn't support.
    See:
    * https://support.mozilla.com/kb/Firefox+keeps+opening+many+tabs+or+windows

  • Mail Services New email with selection doesn't work, leads to Force Quit

    I've posted this before, but got no replies so I'm trying again since it's driving me crazy. It was a problem under Mavericks and still exists under Yosemite's Mail.
    When I select text and then go to the Services menu and pick "New email with selection," much of the time a totally empty new email message window opens , won't let me type in it at all, nor will it close or send. It just sits there until I Force Quit Mail.
    HELP PLEASE!!!

    Standard Apple Mail. I'm running Yosemite 10.10.1, and I'm amazed to see that About Mail says it's Mail Version 8.1 (1993), copyright 1995-2014 Apple Inc. 
    Interesting thought, do you think that it doesn't like to work with itself?  Actually, I'm fairly sure I've had the problem inside of other apps but I should document that.  I'll keep notes to see where this happens. 

Maybe you are looking for

  • Why is so slow filtering links in a website source code?

    I was using Automator extracting links from a webpage, and then i pasted them in a textedit document. I thought it would be better doing it by applescripting, but it's sooooo slow; to grab and filter all the links in a website source code lasts about

  • BDC for Document Clearing - FBRA

    Hi, When I use transaction FBRA and try clearing document then it populates window asking three options - 1. Only Resetting  2. Resetting and Reverse  3. Cancel.  I need to choose 1st option i.e. Only Resetting. I am trying to record the transaction

  • PDF Export on HTML5 Certificate Widgets

    Anyone know where I should start on this? I'd like to have users simply save certificate as a PDF file.  I'm using the new html5 interactions for the certificate to display quiz results variables on the certificate. I found the Dynamic PDF Export Wid

  • JMS with IBM websphere

    Dear friends, i am studying JMS and its concepts. I copied two sample programs for sending messages and receiving messages. I am using Queue. I configured connection factories and Queue in Websphere JMS Provider. Also both files were complied properl

  • Acpi events aren't recognized at startup

    Hi forum! Since 3 weeks my acpi events aren't recognized anymore after startup, no apci_listen and no event-handler-output. I've got to manually type "systemctl restart acpid" to get them working again. What could be the problem? Journallog: http://p