Hi!
I need to be able to add items to the Startup items in preferences.
Could someone help me out.
Thanks!
Can we assume you mean “using an AppleScript to do it”? The process is different in Panther and Jaguar (10.3, and 10.2). Which is it?
yes, via an applescript,
i need it for both Panther and Jaguar
why not add the applications to the users startup items under the preferences folder. This does not need any type of applescript and is very easy, it also allows you to hide them if need be. This will work for Panther. You will need a script for jaguar. You could make a script that will launch all of your applications for you.
jonn8
April 26, 2005, 4:16pm
#5
This is what I use:
–Open this script in a new Script Editor window.
set this_path to (choose file with prompt “Choose an application to add to your Startup Items:” of type {“APPL”})
my add_startup_item (this_path , true )
on add_startup_item (this_path , add_to_startup_items )
try
set this_posix_path to (POSIX path of this_path )
set this_posix_path_alt to this_posix_path ’s text 1 thru -2 –necessary if the app is a bundle which would end in a trailing slash
tell application “System Events”
set all_paths to (get path of login items )
set item_exists to ((all_paths contains this_posix_path ) or (all_paths contains this_posix_path_alt ))
if add_to_startup_items then
if not item_exists then make login item at end with properties {path :this_posix_path , hidden :false }
else
if item_exists then
repeat with i from (count all_paths ) to 1 by -1
if (all_paths ’s item i = this_posix_path ) or (all_paths ’s item i = this_posix_path_alt ) then
delete login item i
exit repeat
end if
end repeat
end if
end if
end tell
end try
end add_startup_item
Jon
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code ]