How to make a script for a terminal command

I need to find instructions on how to create a script to automatically run the following Terminal command;
Sudo chmod 755 /private/var/spool/cups. It will also need to include the admin password as you will be prompted to enter it after the command line is entered. Apparently the only way to get Quark 7 to print adobe pdf's is to open a terminal window and type the command every time the machine is rebooted. This is a temporary fix and I do not want the MAC users to have to type the command.
Thanks
Sal

This Script works here. Get you the error, when you save or checks the syntax?
When you use in AppleScript the entry with administrator privileges, is sudo optional. This says only, if everyone can use the sudo command inside of the 5 minutes limit without to write the password again or not.
The Syntax do shell script "sudo chmod 755 "private/var/spool/cups" password "***" doesn´t work, because you need the entry with administrator privileges for the execution as privileged user.

Similar Messages

  • How to make Apple Script do a terminal command

    Hey,
    I am wondering how can I make an AppleScript do the following command :
    "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    Please mention step by step since I'm new to AppleScript
    Best Regards,
    Nadav.

    To run a terminal command it is usually sufficient to use do shell script. So for your command it would be
    do shell script "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    note if the command requires administrator privileges you would need to do
    do shell script "command"  with administrator privileges
    will prompt for the password when the script is run.
    do shell script "command" user name "me" password "mypassword" with administrator privileges
    will store the password and username in the script. More convenient but much less secure.
    See do shell script in AppleScript

  • How to make a script for find text object?

    Hi everyone
    I want to make a script for find and select text object and then find next, find next, and so on, but without any open dialog
    Is that possible make a script for this?
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "(\[\x{2022}\])|(\x{25CF})";
    app.findGrep();
    thanks
    Regard

    You already have that. A script does not 'find, select, find next' - it finds all texts as soon as you execute the 'app.findGrep' command.

  • How to make a script for expand column width

    Hi experts,
    Is that possible to make a script for expand the column width aim to let the columns show up all the overset text?
    Regard
    John

    Hi John,
    As Uwe advised it would be wise to put a stop on any while loop in case the condition is never fulfilled which would mean the script will break.
    Without knowing what specifically you are working on you could make the below amendments to do this.
    myTables = app.documents[0].stories.everyItem().tables.everyItem().getElements();
    for (var t = 0; t < myTables.length; t++) {
        BE_resizeColumnsToFitContents(myTables[t], 200);
    function BE_resizeColumnsToFitContents(tableToEdit, tableMaxWidth) {
        for (var i = 0; i < tableToEdit.columns.length; i++) {
            while (tableToEdit.columns[i].overflows === true) {
                if (tableToEdit.width < tableMaxWidth) {
                    tableToEdit.columns[i].width += 1;
                    tableToEdit.columns[i].recompose();
                else {
                    alert("Column " + i + " contents too large for column.");
                    break;
    I won't put any extra functions in this because it might not be what you're after. To use this you just define the table width as a second argument to the function (but you could change this parameter to something else, like page, column or cell width). And, if you want to have a fail action you just put it in the 'else' part.
    Brett

  • How to make htm-file for simple toolbar command?

    Hi
    I am actually tryin to make my own toolbar with commands for Adobe Contribute CS5. A very nice companion for DW sites for endusers to edit the site.
    Creatin toolbars for Contribute and Dreamweaver is the same thats why writig here.
    I have managed to make a toolbar and managed to copy existing commands, like browsing backward and browsing forward, in it, but I have not been able to make my own commands  because I have not been able to figure out how to write the correct javascript into the header of the htm-file.
    I have a set of small predefined html-tables, 15 of them, that user can copypaste into his template generated page, when editing, in order to have some layout order without knowing much of editing with Contribute editor.
    Now, I desperately want to have 15 descriptive buttons in my own toolbar appear when in editing mode. User can choose and click the one he needs, a title1-unit, a title2 unit, a 1-column text unit, 2-column text unit etc. The correctly formatted table enhanced with css-properties appear there where the cursor was positioned. No more copying from one page and pasting to another - much much better this way!
    All I need is htm-file for each of those 15 units. I have not been able to find an example that I could modify.
    Can anyone help. A button (a command) klicked on a toolbar should position the htmltable there where the cursor is - nothing else.
    Htm-files should be positioned here, I think:
    C:\Program Files\Adobe\Adobe Contribute CS5\App\Configuration\Toolbars\MM
    Or is C:\Program Files\Adobe\Adobe Contribute CS5\App\Configuration\Objects\ better?
    Eagerly waiting an answer,
    Kari
    Here is an example of a 1-column unit. All 15 of my units are like this.
    <table border="0" cellpadding="0" cellspacing="0" class="unit1 spacebelow" name="text_1col">
         <tr>
              <td class="txttd unit_pad1_left unit_pad1_right bkgr_check3">
                   <p>Text here</p>
              </td>
              </tr>
    </table>

    This Script works here. Get you the error, when you save or checks the syntax?
    When you use in AppleScript the entry with administrator privileges, is sudo optional. This says only, if everyone can use the sudo command inside of the 5 minutes limit without to write the password again or not.
    The Syntax do shell script "sudo chmod 755 "private/var/spool/cups" password "***" doesn´t work, because you need the entry with administrator privileges for the execution as privileged user.

  • Make a script for build table

    Hi everyone
    How to make a script for build table:
    col width 25mm
    align decimal
    align on close paren
    Thanks
    Teetan

    Hi Teetan VK,
    Merry Chrismas.
    I'm not really an InDesign scripter.
    But you can try the following code:
    // TableCreate_simple.jsx
    // regards pixxxelschubser
    var aDoc = app.activeDocument;
    // your width of every column
    var w = Number(prompt("width of columns", 25));
    var NrOfColumns = 3;
    var aTextFrame = aDoc.textFrames.add({visibleBounds:[0, 0, 30, NrOfColumns*w + 1]});
    var aTable = aTextFrame.insertionPoints[0].tables.add({columnCount:NrOfColumns,bodyRowCount:1});
    for (i=0; i<aTable.columns.length; i++) {
    aTable.columns[i].width = w;
    // Paragraph sytyle with decimal aligning should already exists in your document
    for (j = 0; j < aTable.cells.length; j++) {
        aTable.cells[j].texts[0].appliedParagraphStyle = aDoc.paragraphStyles.item("AlignDecimal");
    Be sure, that a paragraph style (named with "AlignDecimal") exists in your Document.
    But what is:
    Teetan VK schrieb:
    … align on close paren …

  • How to make a form for input in web interface builder

    Hi expert:
        How to make a form for input in web interface builder?I have already used it to do PS planning, but I don't know how to  draw lines and checkboxes . Thanks in advance.
    Allen

    WAD:
    Open the WAD and create a new template. On the left hand navigation you will have several Web Items available. Under 'Standard' you have 'Analysis' item. Pull that into your template to the right. Under the Properties tab you need to pick the query [form/layout] that you have built in Query Designer.
    You will also find other items such as Button group, Checkbox, drop down, list box etc available. Pick and drag into the template whatever it is you require. Lets say you want a button. Under the Properties tab select the 'Command' that you require. You could use standard commands that are available there. You could also define functions and commands that you require.
    Query Designer:
    Open the QD and drag the characteristics and key figures that you require into the rows and columns of the QD. You would need to specify restrictions under the Filter tab of the QD based on the granularity of data that you require. You would need to remember that the key figures need to be made Input Ready [do this by clicking on KF and on the planning tab select "change by user and planning functions"].
    This shouldgive you a start. After you've explored it yourself a bit we can discuss further and I can certainly provide you additional details/material on these areas.
    Srikant

  • How to make a group for selectd Object javascript

    How to make a group for selectd Object javascript

    There is currently no native way to email groups from iPad.
    The only way to do this is if your recipients are already members a a distribution group controlled elsewhere such as a Google Group or an  Exchange Organisation, then you can email the distribution group address which will then in turn forward to the individual email address of the members.
    Does it have to be email as currently you would have to add each recipient to the email manually.
    iOS to my knowledge doesn't support contact groups in context other than organisation.

  • How to make S-Curve for Primavear P6 by using BI publisher?

    Hi,
    Anyone knows how to make S-Curve for Primavear P6 by using BI publisher? I can display colunm such as planned unit, but not cumulative value. So I can't plot S-curve.
    Thanks
    Wang Xin
    Edited by: 957906 on 09-Sep-2012 03:26

    The problem with the datagridview is that it can only show one table.
    For more tables 3th party datagrid's are better. 
    Although you can start with using the old datagrid. Despite what is written on MSDN is it a complete different control then the datagridview. You can add in to your toolbox by right clicking on it and then add it.
    The datasource of a DataGrid can be a complete dataset which is showed with all its relations.
    Success
    Cor

  • We plan to install Adobe Illustrator in our Terminal Server environment. How is the licensing work for a Terminal Server installation?

    We plan to install Adobe Illustrator in our Terminal Server environment. How is the licensing work for a Terminal Server installation?

    nefabit,
    This is a question for a chat or a phone support call:
    Creative Cloud support (all Creative Cloud customer service issues, chat open between 5AM and 7PM PST/PDT on workdays)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html
    Get help with orders, refunds, and exchanges (non-CC, chat open between 5AM and 7PM PST/PDT on workdays)
    http://helpx.adobe.com/x-productkb/global/service-b.html
    Adobe Support (phone),
    http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html

  • How to make a CheckBox for a report parameter?

    Hi,
    How to make a CheckBox for a report parameter?
    thanx

    design ur parameters forms using forms and call ur report form there

  • How to make a installer for iphone application

    hi, dear all, I have made a iphone application by XCode , it can running perfect on emulator . I want it can be install on real device , how to do it ? how to make a installer for my iphone application ?
    thanks to your response .

    If you go to the iPhone DEV area on Apple.com you can get a installer app once you are a developer. This installer will let you use apps for your own use. This installer app also supports up to X amount of phones you can install the application on. I thought it was set at 100 but could be now up to 500.

  • How to make a wall for a game

    hello developers
    I’m sharing a long time to find out how to make a wall for my game but now where is it.
    Can someone help me?
    its a wall for an iphone/ipod game.
    It must be a wall that a sprite will stop walking it’s not a killer object but a stop object.
    oh and are there differants in programing in ipad/iphone?
    Thanks for help
    Grtz Jimmy

    I don't know what's you point on the wall and the player but you should do something as that:
    -(IBAction)goLeft
         if (player.x > wall.xo && player.x < wall.xI)
                  // you are in the wall go right
              if(player.y > wall.yo && player.y < wall.yI)
                 // you are in the wall go right
                 player.x ++;
              else ; // you are up or down of wall
    -(IBAction)goRight
        if (player.x > wall.xo && player.x < wall.xI)
              if(player.y > wall.yo && player.y < wall.yI)
                 // you are in the wall go left
                 player.x --;
               else ; // you are up or down of wall

  • How to make a program for backgroung processing used servlet

    how to make a program for backgroung processing used servlet

    well i need the coding part written in servlet ,in which servlet is always ready for accepting a client request.

  • How to make exception rules for Stylish rules which change fonts?

    How to make exception rules for Stylish rules which change fonts?
    I use [https://addons.mozilla.org/en-US/firefox/addon/stylish/ Stylish add-on] to change specific fonts to other fonts of my choice, but I have a problem. I want to change the font Arial to Tahoma in almost all pages I visit, but with the exception of websites as wikipedia.org. Because of this, I find myself having a very long list of domains to change Arial to Tahoma, only because I don't want that rule to apply to wikipedia.org and additional one or two other websites.
    The current rule I'm using is, (my actual list is a lot longer, but this is just an example):<br/>
    '''''@-moz-document domain("mozilla.org"), domain("thefreelibrary.com"), domain("sil.org"), domain("ethnologue.com") {'''''<br/>
    '''''@font-face { font-family: 'Arial'; src: local('Tahoma'); }'''''<br/>
    I can't use the following rule because I don't want it to apply to wikipedia.org:<br/>
    '''''@font-face { font-family: 'Arial'; src: local('Tahoma'); }'''''

    Try something like this:<br />
    <br />
    <pre><nowiki>@font-face { font-family: 'Arial'; src: local('Tahoma'); }
    @-moz-document domain(wikipedia.org){
    @font-face { font-family: 'Arial'; src: local('Arial'); }
    </nowiki></pre>

Maybe you are looking for

  • Labview FPGA: Why not have local variable without indicator?

    In Labview FPGA, to transfer data among parallel loops, there are three ways or maybe more, local variable, global variable and block memory. The problem with local variable is that it needs an indicator along with, not like global variable. I was th

  • ITunes crashes when converting to mp3

    Hi, I'm having an issue when using the "convert selection to mp3" in iTunes. I have a large portion of my library stored at high bit-rate mp3 (some variable bitrate). I would like to convert these to 128bit mp3. When converting some tracks, it crashe

  • How to know in which roles a given query is ?

    Hello, Suppose I have a certain query. Is there a way to know in which roles this query is other than do a manual search in pfcg?

  • User Exit triggers BAPI BAPI_GOODSMVT_CREATE

    Hi Super Gurus! I have a complex situation, till now no solution is being provided. Does anybody know how can I trigger the BAPI BAPI_GOODSMVT_CREATE in a plant for make automatic recepction of a STO? I wanted to trigger it once shipment is another p

  • What to do when stuck on apple logo

    My classic iPod had a low battery, and now, after trying to recharge (and reset), it is stuck on the Apple logo