Professional Web Applications Themes

osascript & open work on all OSX versions? - Mac Programming

Hi all- Will these scripts work on all OSX versions? #!/bin/csh osascript -e 'tell application "Mozilla" to quit' #!/bin/csh open '/Applications/Myapp.app' I'm making a Filestorm installer & it uses unix shell scripts to allow the installers to do custom actions. Thanks- matt...

  1. #1

    Default osascript & open work on all OSX versions?

    Hi all-


    Will these scripts work on all OSX versions?

    #!/bin/csh
    osascript -e 'tell application "Mozilla" to quit'

    #!/bin/csh
    open '/Applications/Myapp.app'

    I'm making a Filestorm installer & it uses unix shell scripts to allow
    the installers to do custom actions.

    Thanks-
    matt
    Matt Guest

  2. #2

    Default Re: osascript & open work on all OSX versions?

    Matt Pease wrote:
     

    Yes, osascript has been available since 10.0. But what if Mozilla isn't
    running? That line will open it and then tell it to quit, which is
    pretty odd.
     

    open has been available since 10.0 as well (and NeXTSTEP too!). But
    what if Myapp.app isn't in /Applications?

    --
    Pull out a splinter to reply.
    Peter Guest

  3. #3

    Default Re: osascript & open work on all OSX versions?

    Hi Matt,


    "Matt Pease" <com> writes: 
    >>
    >> Yes, osascript has been available since 10.0. But what if Mozilla
    >> isn't running? That line will open it and then tell it to quit,
    >> which is pretty odd.[/ref]
    > I'm running 10.3 & when I type execute that line, Mozilla doesn't
    > start for me. Would it be starting on some other version of OSX?[/ref]

    When I try it as shown, I get an cryptic error message. When I
    replace "Mozilla" with "Safari" it starts Safari and than Safari exits
    automatically. This is the expected behaviour. I'd guess there are
    ways in AppleScript to ask if an application is running.
     
    >>
    >> open has been available since 10.0 as well (and NeXTSTEP too!).
    >> But what if Myapp.app isn't in /Applications?[/ref][/ref]

    It's probably better to use

    open -a Myapp

    which will work through the Finder database.
     

    There is some confusion here. These folders always have the same name
    on the disk, but they are shown with localized names by the Finder. I
    am not sure how the Finder's AppleScript interface actually wants
    them.


    benny
    Benjamin Guest

  4. #4

    Default Re: osascript & open work on all OSX versions?

    On 27/02/2004, Matt Pease wrote in message
    <google.com>:
     

    That command exists in all stable forms of OS X but osascript has
    different behaviours and switches in different versions of OS X.
    It's not quite as trustworthy as 'open' and it's a lot more
    complicated.
     

    That will work in all versions of OS X so far.

    Note:

    You should not be putting your own applications into /Applications
    unless the user has specifically asked for it. You never know what
    Apple will do with their own folders and they may come up with an
    application with the same name as yours. A good place for non-Apple
    applications is /Shared, possibly in /Shared/Applications. Also,
    non-admin users can't install stuff into /Applications.

    Simon.
    --
    Using pre-release version of newsreader.
    Please tell me if it does weird things.
    Simon Guest

  5. #5

    Default Re: osascript & open work on all OSX versions?

    In article <c1u1jh$ma7$9$demon.co.uk>,
    Simon Slavin <demon.co.uk> wrote:
     

    That's a nice theory but:

    1. When I "Go to Applications", I want to see my applications, not some of my
    applications.
    2. I don't believe that there is a FindFolder constant that will produce
    /Shared/Applications.

    Until special folders (Doents, Applications, etc) start behaving in the same
    magic way as the Trash does (i.e. displaying the union of the contents of the
    relevant folders across several domains), /Applications and
    /Applications/Utilities will be superior to any other Applications and
    Utilities, and ~/Doents, ~/Music, ~/Movies, and ~/Pictures will likewise be
    superior to any alternatives.

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  6. #6

    Default Re: osascript & open work on all OSX versions?

    On 29/02/2004, Miro Jurisic wrote in message <macdev-
    mit.edu>:
     
    >
    > That's a nice theory but:
    >
    > 1. When I "Go to Applications", I want to see my applications, not some
    > of my applications.[/ref]

    What is 'Go to Applications' ? I can't see anything called this.

    What is 'your applications' ? There is no one folder which
    contains even all of Apple's applications -- they're spread over
    at least six different folders.
     

    Why are you using FindFolder ? This has nothing to do with how
    you install applications.
     

    I really don't see what you're getting at here. None of those folders
    do what you seem to be talking about. And you shouldn't ignore the
    fact that many of your prospective users will /not/ have the ability
    to write to /Applications. One of the great advantages of OS X is the
    ability to keep your own programs wherever you want.

    Simon.
    --
    Using pre-release version of newsreader.
    Please tell me if it does weird things.
    Simon Guest

  7. #7

    Default Re: osascript & open work on all OSX versions?

    In article <c25tj3$qcc$5$demon.co.uk>,
    Simon Slavin <demon.co.uk> wrote:
     
    >
    > What is 'Go to Applications' ? I can't see anything called this.[/ref]

    Go menu in the Finder.
     [/ref]
     

    I thought you were telling him that the right place to install binaries is
    /Shared/Applications, and I am telling you there is no way for an installer to
    find /Shared/Applications using FindFolder. In other words, you are proposing
    that he hardcode a path to a folder (/Shared/Applications), and that he use a
    folder that is not the most visible Applications folder in the Finder. I find
    both of those suggestions suboptimal.
     

    What I am getting at here is that there is precisely one thing labelled
    "Applications" in the Finder and therefore the only way that Joe Random User
    knows how to get to his applications is by clicking that one thing in the
    Finder. Therefore, the best place to put an application is in /Applications,
    unless you can't put it there (no permissions). /Shared/Applications is a good
    idea in theory, but until the Finder makes it trivial to get to those
    Applications, it's nothing but a good theory.

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

Similar Threads

  1. Installing upgrade versions to new computer without previous versions
    By Barry_Mortin@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 2
    Last Post: June 18th, 05:07 PM
  2. How can you open CS files with previous versions?
    By Victor_Avila@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 2
    Last Post: March 3rd, 10:26 PM
  3. CS can't open AI10 files saved as earlier versions (9 and earlier)
    By kurt_triffet@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 0
    Last Post: February 27th, 12:04 AM
  4. How to save a Illustrator CS to open in previous versions?
    By Robert_Witrak@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 2
    Last Post: February 9th, 05:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139