• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help in creating a Start Up item in Panther
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help in creating a Start Up item in Panther


  • Subject: Re: Help in creating a Start Up item in Panther
  • From: Matthew Smith <email@hidden>
  • Date: Thu, 12 May 2005 01:09:09 +1000

Title: Re: Help in creating a Start Up item in Panther
For this to be effective the AppleScript application has to be running under the same user as the logged in user, otherwise when it tries to communicate with System Events it won’t be able to find the same running instance of it as the logged in user. You can see this when using Fast User Switching and logging in with another account. It does not have access to the other running account.

If you want to run it under the same login as the user you will also find the user will have privilege to terminate the AppleScript application, hence defeating the reason you want this. You also have not considered the other applications that can access the MSN Messenger service, for example Proteus and Adium.

A better way to implement this is to write it totally as a shell script that runs under root, identifying the unix processes and killing them. However perhaps you should be asking (somewhere else) what is the best way of stopping staff from using MSN Messenger and Limewire. You might find a better solution than the one you decided.

Why do you allow them to access MSN Messenger and Limewire outside the work hours? A simpler solution would be to not allow access at any time when on the company network.

--
Matthew Smith



From: Bernardo Hoehl <email@hidden>
Date: Wed, 11 May 2005 11:31:35 -0300
To: Applescript_list <email@hidden>
Subject: Help in creating a Start Up item in Panther

Hi List,

I have an applescript saved as an application that I want to have it running before the users log in.

I am trying to follow up this article from developer.apple.com:

http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/StartupItems.html

I need some help with the shell script executable, which I guess should look so:

+++++++++++++ shell script begins... ++++++++++++++

#!/bin/sh

. /etc/rc.common

open /Library/Scripts/MyScriptsFolder/NameofMyScript.app

++++++++++++++ shell script ends ++++++++++++++++

Is this correct?

In the StartUpParameters.plist file I have no clue what to include in the "Provides", "Requires" and "Uses" parameters...

At the bottom of this message you will find the applescript application, just in case you wonder.

( I am trying to prohibit users from using MSN messenger and Limewire during working hours)

I used Drop Script Backgrounder to hide the app's icon from appearing in the Dock...

Thank you for your kind attention,


Bernardo Höhl
Rio de Janeiro - Brazil

on idle
    repeat while true
        tell application "System Events"
            if name of every process contains "MSN Messenger Daemon" or name of every process contains "Limewire" then
                if time of (current date) > 28800 and time of (current date) < 64080 then -- from 08:00 to 17:48
                    if time of (current date) > 46800 and time of (current date) < 50400 then -- from 13:00 to 14:00
                        --do nothing, lunch time
                    else
                        try
                            tell application "MSN Messenger" to quit
                            tell application "LimeWire" to quit
                        end try
                    end if
                end if
            end if
        end tell
        return 20
    end repeat
     
end idle

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help in creating a Start Up item in Panther
      • From: Bernardo Hoehl <email@hidden>
    • Re: Help in creating a Start Up item in Panther
      • From: James Dessart <email@hidden>
References: 
 >Help in creating a Start Up item in Panther (From: Bernardo Hoehl <email@hidden>)

  • Prev by Date: Re: Shortcut keys
  • Next by Date: Re: Shortcut keys
  • Previous by thread: Help in creating a Start Up item in Panther
  • Next by thread: Re: Help in creating a Start Up item in Panther
  • Index(es):
    • Date
    • Thread