Need help writing and Apple Script

I've never written an apple script before so I need the entire tutorial for dummies. Basically, I am annoyed with the fact that Microsoft Word 08 keeps opening a new document at 100% zoom when I want it to open at "page width." How do I write a script for that?

You don't need an Applescript. Open the New Document template, resize as you like then save the template.
To learn Applescript start here. You will also find support at the Applescript site for developers. Your local book store or Amazon.com have dozens of books on Applescript programming.
Here's the main site for obtaining Applescripts.

Similar Messages

  • I need help writing an apple script

    earlier I made an application with automater saying that when it opens it would add something to my todo list, for example, the subject being english and priority being very high. Then I made an apple script telling it to open the application I made. Then I made a mail rule telling it that if i text my computer and the text includes english and very important (english is subject and very important is the priority) it would open the apple script that tells the application i made to open and put english in my todo list. Can someone tell me how I can make a script in which it puts whatever I text my computer in my todo list, so if i text my computer anything random it would put it in my todo list

    Well after a bit of head scratching I have done it! And it was simpler than I expected although I'm sure the script can be improved, it does what I want it to do. Any suggestions on improvements would be welcome.
    Andy E
    The script...
    set artistName to text returned of (display dialog “Enter artists name:” default answer “”)
    set artistSortName to text returned of (display dialog “Enter artists sort name:” default answer “”)
    if artistName is “” then
    set tempVer to display dialog “No artist name specified!” buttons {“OK”}
    return
    end if
    if artistSortName is “” then
    set tempVer to display dialog “No artist sort name specified!” buttons {“OK”}
    return
    end if
    tell application “iTunes”
    activate
    set theLibrary to library playlist “Library”
    set searchList to search theLibrary for artistName
    repeat with thisTrack in searchList
    set thisArtist to artist of thisTrack
    if thisArtist is equal to artistName then
    set sort artist of thisTrack to artistSortName
    end if
    end repeat
    end tell
    15" MacBook Pro 2.16GHz, 2GB Ram   Mac OS X (10.4.10)   It's my first Mac and I love it!

  • Need Help Writing a Shell Script

    Basically I'm writing a script that opens TextEdit so I can open it from the Terminal. I also want it to run in the background so I can continue using the Terminal without having to quit TextEdit first. So far I've figured out two ways of doing this, and neither one does exactly what I want it to do. Here's the first one I tried:
    /Applications/TextEdit.app/Contents/MacOS/TextEdit $@ &
    The problem with this is that if TextEdit is already running, it opens a new instance of it to open the files, and it doesn't bring the app into focus when I run it. So I decided to try this:
    open -a "TextEdit" $@ &
    This way all files open in the same instance of TextEdit and it brings the app to the front, but it won't let me save anything I don't have write privileges for, even if I run it with sudo. I Googled it and apparently what happens is it runs "open" as root but runs the actual application that I'm opening as the current user.
    So basically what I need to know is if there's a way of doing this that will congregate all files into the same instance of TextEdit and bring the app to the front when I launch it, but still let me run it as root with sudo. If not, is there at least a way to check if TextEdit is running and throw an error if it is?

    #!/usr/bin/env bash
    if ps ax | grep '[T]extEdit'; then
    echo "TextEdit is already running!"
    else
    /Applications/TextEdit.app/Contents/MacOS/TextEdit &
    fi
    open -a TextEdit "$@"
    osascript -e 'tell application "TextEdit" to activate'
    Example:
    your.script "text file.txt"
    NOTE 1: When posting code to this forum, enclose your code in
    ...your code goes here...
    This will make sure that all your indentation and other meta-characters that might get interpreted by the forum code will be left alone.
    NOTE 2: The $@ will ONLY preserve quoted strings as a single argument if it is specified as "$@". That is to say it MUST be inside a pair fo double-quotes. Otherwise it is the same as $* The missing ".." are what messed up your ability to treat a file with space as a single argument. ALSO NOTE, I specified the file on the command line inside quotes (could be single or double), or you could use  if you desire.
    NOTE 2 and a half:
    If you DO NOT want to put quotes around the space filled filename when invoking your script, you could change your "$@" to "$*"
    open -a TextEdit "$*"
    The difference is that using "$@" will allow specifying several filenames on the command line and TextEdit will open all of them at once. The use of "$*" means you can only open 1 file per use of your script. Not a big deal, but I figured you should know the options available to you.
    NOTE 3: I've simplified your script.
    I do not know why you decided that if you are root you wanted to use sudo, since sudo gives normal users root privileges, and root already has root privileges.
    Actually based on earlier exchanges, I would have thought that you wanted to start TextEdit using sudo, unless it was already running:
    sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit &
    so that you had root privileges allowing you to write files in places you were normally not allowed. Then again, maybe I was reading the earlier posting wrong (won't be the first time ).
    NOTE 4: The use of
    if [ "$textedit" > /dev/null ]; then
    is just plain wierd This translates to the command:
    test "$textedit" >/dev/null
    which redirects standard output into /dev/null, so the actually command looks like
    test "$textedit"
    which will essentially return TRUE if $textedit has a string in it, and FALSE if $textedit is empty.
    I decided to just use the completion status of the grep command as a way to decide if TextEdit was running on not.
    NOTE 5: I simplified the ps|grep|grep command with a trick I learned several years ago. The '[T]extEdit' regular expression exactly matchs TextEdit, except that it DOES NOT match a ps line that has '[T]extEdit'. So I can get rid of one grep command because it will never match the grep command in the ps output.
    NOTE 6: I moved the open and osascript commands outside the if structure, as I assumed you wanted osascript to bring TextEdit to the foreground regardless of whether it was already running or not, and the open command was identical for both halfs of the if structure. If this is a bad assumption, feel free do put it back inside the if structure.
    Message was edited by: BobHarris

  • Need Help Writing a Calculation Script Using a Checkbox

    Hello,
    I am new to Adobe X Standard and Javascript.  I have all other parts of my fillable change order form completed except the tax calculation.  I have the following fields:
    Text Field = SUBTOTAL
    Text Field = TAX
    Checkbox = Exempt
    I would like the calculation in the TAX field to be as follows:
    If the checkbox = false then SUBTOTAL * .05, else SUBTOTAL = 0. 
    It really doesn't seem that complex but learning javascript on the fly is apparently above my skill level.  I would greatly appreciate someone's help in getting this initial calculation working.  I greatly appreciate your time.  Thank you.

    Your description is a bit confusing to me. Do you want to calculate the value of the TAX field? In the last bit of pseudocode, you seem to be setting SUBTOTAL to 0. Do you want the tax to be the SUBTOTAL value times 0.05 if not exempt and 0 if exempt? If so, the custom calculate script of the TAX field can be:
    event.value = getField("Exempt").value === "Off" ? +getField("SUBTOTAL").value * 0.05 : 0;
    This is equivalent to:
    if (getField("Exempt").value === "Off") {
        event.value = +getField("SUBTOTAL").value * 0.05;
    } else {
        event.value = 0;

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • My grandma is a new apple user and she needs help making an apple account.

    my grandma is a new apple user and she needs help making an apple account.

    She should call Apple support or visit the Genius Bar at an Apple store (make an appointment first at http://apple.com/retail). They will walk her through the process.

  • Need help to Settings Apple iMAC 2012 and HP LaserJet 1100.

    Need help to Settings Apple iMAC 2012 and HP LaserJet 1100.
    I purchased a imac, 2012, before there was Windows 7. I have the HP LaserJet 1100 and Print Servers Trendnet TE100 P21, with Windows 7 it ​​worked, but with MAC OSX 10.8 does not want to, do not go printing. Could help with the setting?
    Нужна помощь в настроке Apple iMAC 2012 и HP LaserJet 1100.
    Я купил imac 2012, до этого был Windows 7. У меня есть принтер HP LaserJet 1100 и принтсервер Trendnet TE100 P21, с Windows 7 все работало, но с MAC OSX 10.8 работать не хочет, не идет печать. Могли бы помочь с настройкой?

    привет Roman,
    Mac OS X: About the Reset Printing System feature ...
    http://support.apple.com/kb/HT1341?viewlocale=en_US
    10.5/10.6/10.7/10.8 instructions...
    In System Preferences>Fax & Print, Right click or Control+click on the Printers list Sidebar, choose Reset Printing System.
    if you hold option and click the "-" tab it resets the printing system.
    http://www.macosxhints.com/article.php?story=20031215144430486
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions.
    Any devices that previously appeared in your Printer List and Fax List will need to be added again after resetting the printing system.
    Resetting the printing system in Mac OS X 10.5.x+++
        1.    To use the Reset Printing System feature in Mac OS X 10.5.x, follow these steps:
        2.    Choose System Preferences from the Apple menu.
        3.    Choose Print & Fax from the View menu.
        4.    Control-click on list of printers on the left side of the window, then choose "Reset printing system" from the contextual menu. If you don't see a list of printers, Control-click on the text "Click + to add a printer or fax" and select "Reset printing system..." 
   
  As an alternative, if you currently have one or more printers listed, you can Option-click the "-" (Remove printer) button.
    http://support.apple.com/kb/ht1341
    Reboot.
    Mac OS X: О сброса системы Печать ...
    http://support.apple.com/kb/HT1341?viewlocale=en_US
    10.5/10.6/10.7/10.8 инструкции ...
    В System Preferences> Печать и факс, правой кнопкой мыши или Control + Click на боковой панели списка принтеров, выберите Сброс системы печати.
    если вы держите опцию и нажмите кнопку "-" на вкладке он сбрасывает систему печати.
    http://www.macosxhints.com/article.php?story=20031215144430486
    Безопасная загрузка с HD, (Удержание нажатой клавиши Shift нажатой при загрузке), запустите Disk Utility в Приложения> Утилиты, затем выделите диск, нажмите на ремонт разрешения.
    Любые устройства, которые ранее появились в списке принтеров и факсов список необходимо будет добавить снова после перезагрузки системы печати.
    Сброс системы печати в Mac OS X 10.5.x + + +
    1. Для сброса системы печати в Mac OS X 10.5.x, выполните следующие действия:
    2. Выберите Системные настройки в меню Apple.
    3. Выбери для печати и факса в меню Вид.
    4. Управление кнопкой мыши на список принтеров в левой части окна, затем выберите "Сброс системы печати" из контекстного меню. Если вы не видите списка принтеров, управление кнопкой мыши на текст "Нажмите, чтобы добавить + принтер или факс" и выберите "Сброс системы печати ..." В качестве альтернативы, если у Вас уже есть один или несколько принтеров в списке, можно Option-нажмите кнопку "-" (Удалить принтер) кнопки.
    http://support.apple.com/kb/ht1341
    Перезагрузку.

  • Airport and Apple Script - on and off script

    I've had this problem for a while, trying to turn the airport card in a computer on and off using and apple script. i need it to automatically turn on or off depending on which account if logging into the computer.
    I did find that a solution can be found by writing an apple script to turn airport on and off. but my scripting skills aren't good and haven't worked thus far.
    So now i'm asking everyone: Can anyone write a script to turn the airport on or off? I bet you can't. (there's some motivation for you)
    I think it's my last resort, turning to other apple user and requesting help, because i have not been able to find another solution or a prewritten script (surprisingly)
    Thanks very much for your help!
    "i'll gladly pay you tuesday for a an apple script today."
    thanks

    I haven't used these tools so I don't know for sure, but doesn't Tiger's parental controls (in the Accounts preference pane) allow you to enable/disable network access by account? Would that work to solve your problem?
    EDIT: OK, by starting a new thread I guess you got the same response that I posted for your previous thread. For those interested, this is a continuation of the thread kevin macky, "Account with and without airport internet access", 08:07am Oct 11, 2005 CDT.
    If you are interested in trying to automate this, I suggest that you post your question in these areas:
    Mac OS X > Mac OS X Technologies > AppleScript
    Mac OS X > Mac OS X v10.4 Tiger > Automator

  • Need Help Writing Server side to submit form via API

    Hey
    I need help writing a serverside application to submit
    information via API to a separate server.
    I have a client that uses constant contact for email
    campaigns. We want to add to her website a form taht submits the
    information needed to subscribe to her email list, to constant
    contact via API.
    FORM.asp :: (i got this one under control)
    name
    email
    and submits to serverside.asp
    SERVERSIDE.ASP
    In serverside.asp i need to have
    the API URL
    (https://api.constantcontact.com/0.1/API_AddSiteVisitor.jsp)
    username (of the constant contact account)
    password (of the constant contact account)
    name (submited from form.asp)
    email (submitted from form.asp)
    redirect URL (confirm.asp)
    Can anyone help get me going in the right direction?
    i have tried several things i found on the net and just cant
    get anyone to work correctly.
    One main issue i keep having is that if i get it to submit to
    the API url correctly - i get a success code, it doesnt redirect to
    the page i am trying to redirect to.
    ASP or ASP.NET code would be find.
    THANKS
    sam

    > This does require server side programming.
    > if you dont know what that is, then you dont know the
    answer to my question. I
    > know what i need to do - i just dont know HOW to do it.
    If you are submitting a form to a script on a remote server,
    and letting
    that script load content to the browser, YOU have no control
    over what it
    loads UNLESS there is some command you can send it that it
    will understand.
    No amount of ASP on your server is going to change what the
    remote script
    does.
    http://www.constantcontact.com/services/api/index.jsp
    they only allow their customers to see the instructions for
    the API so i
    can't search to see IF there is a redirect you can send with
    the form info.
    But posts on their support board say that there is.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Need help writing host program using LabView.

    Need help writing host program using LabView.
    Hello,
    I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
    I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
    eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
    My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
    I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
    Any help would be appreciated.
    Regards, George
    George Dorian
    Sutter Instruments
    51 Digital DR.
    Novato, CA 94949
    USA
    [email protected]
    m
    (415) 883-0128
    FAX (415) 883-0572

    George may not answer you.  He hasn't been online here for almost eight years.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Need help writing small program!

    Hi. I'm learning Java programming, and I need help writing a small program. Please someone help me.
    Directions:
    Create a program called CerealCompare using an if-then-else structure that obtains the price and number of ounces in a box for two boxes of cereal. The program should then output which box costs less per ounce.

    class CerealCompare {
        public static void main(String[] args) {
            // your code goes here
    }Hope that helps.
    P.S. Java does not have an if-then-else statement.

  • Need help for creat apple id in iphone 5s

    need help for creat apple id in iphone 5s

    See this support document for instructions. http://support.apple.com/kb/HT2731

  • I need help in activating apple id to for the find my iphone app

    i need help in activating apple id to for the find my iphone app

    What sort of help are you requesting from us, your fellow users? What exactly is the problem/issue?

  • I need help deleting and adding text

    i need help deleting and adding text, can soneone help
    Adobe Photoshop Elements 10

    You should delete your phone number from the topic line.
    Spambots search these forums for contact info.
    You don't want to get even more telemarketing/scam calls than you probably already get.
    It seems like the "Do Not Call" lists are ignored these days.
    Message was edited by: Bo LeBeau       Looks like someone already took care of this.

  • I need help scrolling and highlighting for a vast amount of pics that I'm trying to transfer. I have a macbook pro osx 10.5.8

    I need help scrolling and highlighting for a vast amount of pics that I'm trying to transfer. I have a macbook pro osx 10.5.8

    I need help scrolling and highlighting for a vast amount of pics that I'm trying to transfer. I have a macbook pro osx 10.5.8

Maybe you are looking for