Script code help

Discussion in 'macOS' started by Stats, Sep 23, 2008.

  1. Stats macrumors newbie

    Joined:
    Sep 23, 2008
    Location:
    Florida
    #1
    «event miscdosc» "DIRECTORY(\"Macintosh HD:Microsoft Office X:Templates:My Templates\")"

    what is this -do

    code says window1 can I use its name instead
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Erm, whatever you tried to do didn't work. Try opening the script and pasting the text...
     
  3. Stats thread starter macrumors newbie

    Joined:
    Sep 23, 2008
    Location:
    Florida
    #3
    tell application "Microsoft Excel"
    Activate
    «event miscdosc» "DIRECTORY(\"Macintosh HD:Microsoft Office X:Templates:My Templates\")"
    Select Range "R1C1:R1C2"
    Save ActiveWorkbook In "Macintosh HD:Microsoft Office X:Templates:My Templates:t test of Means" As xlNormal Password "" WriteReservedPassword "" without ReadOnlyRecommended and CreateBackup
    Close ActiveWindow
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  5. Stats thread starter macrumors newbie

    Joined:
    Sep 23, 2008
    Location:
    Florida
    #5
    tell application "Finder"
    activate
    select Finder window 1
    select Finder window 1
    set target of Finder window 1 to folder "Hypotheses Section" of folder "MOS Templates" of disk "#8"
    select Finder window 1
    select Finder window 1
    open document file "t test of Means " of folder " One Population" of folder "Hypotheses Testing" of folder "Hypotheses Section" of folder "MOS Templates" of disk "#8"
    end tell
    tell application "Microsoft Excel"
    Activate
    «event miscdosc» "DIRECTORY(\"Macintosh HD:Microsoft Office X:Templates:My Templates\")"
    Select Range "R1C1:R1C2"
    Save ActiveWorkbook In "Macintosh HD:Microsoft Office X:Templates:My Templates:t test of Means" As xlNormal Password "" WriteReservedPassword "" without ReadOnlyRecommended and CreateBackup
    Close ActiveWindow
    end tell
    tell application "Finder"
    activate
    select Finder window 1
    select Finder window 1
    open document file "Variance Test w/ Chi Sq" of folder " One Population" of folder "Hypotheses Testing" of folder "Hypotheses Section" of disk "#8"
    end tell
     
  6. pit29 macrumors 6502a

    pit29

    Joined:
    May 23, 2006
    Location:
    The Golden State
    #6
    Maybe I just don't get it, but maybe it would help if you explain what you want to do, and where it does not work, instead of posting code.
     
  7. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    In that case, yes you can use the window title. For example
    Code:
    tell application "Finder"
    	select Finder window "robbie"
    end tell
    
    selects the window with my home folder in it (if there is one, this will fail if there is no such window)
     
  8. Stats thread starter macrumors newbie

    Joined:
    Sep 23, 2008
    Location:
    Florida
    #8
    It is very simple -open My templates -open a file -save the file to My templates- close file
     

Share This Page