Link to home
Start Free TrialLog in
Avatar of kimakabane
kimakabaneFlag for Japan

asked on

Script to mount hundred of DVD iso image on Windows Share at OSX startup

(OSX 10.6.3 / Mac Mini Mid 2010)
(Windows Server 2008 64bit))

Hello,

I want to write script to mount hundred of iso image on windows share at startup.
At the beginning, I use login config through "system preference > accounts > login items",
however this didn't work well.

ISO mount fails because of timeout error. I have around 100 iso images but in most cases
mount fails at 60-70, but sometimes 90 ok.
I have old intel MacMini 10.5.8 and had been had no problem at all.

Now I gave up to resolve mount failure and try to write mount script at startup.

Script requirements are
- Run at startup
- Can adjust startup timing ( by using such as sleep command which windows has)

Thank you so much for your help.
If you have idea other than above scripting, please let me know.
Avatar of nxnw
nxnw
Flag of Canada image

This script works with a mechanism similar to the OS 9 (and earlier) startup items folder.
To use the script,
1. make a new folder named "staggeredlaunchitems" in your preference folder (the one in the library in your home directory)
2. put aliases of the files you want to open/applications you want to launch into the staggeredlaunchitems folder
3. launch applescript editor and paste the attached code snippet into a new applescript
4. customize the delays, if desired, in the two "set" commands at the top of the script
5. save the script as an application, and make it a login item (in accounts under system prefs)
6. any login items that are now being launched by the script should be removed from the login items pane (in accounts under system prefs).

The files in your staggeredlaunchitems folder will launch in accordance with the set delays. They will launch in alphabetical order according to the names of the aliases. Change the names of the aliases to change the launch order.
-- this script emulates to OS 9 (and earlier) startup items folder, with the added ability to stagger and delay launches
-- to use this script, 
--   1. make a new folder in your preference folder (the one in the library in your home directory) called (exactly)
--       staggeredlaunchitems
--   2. put aliases of the files you want to open/applications you want to launch into the staggeredlaunchitems
--   3. customize the delays, if desired, in the two "set" commands at the top of the script
--   4. save this script as an application, and make it a login item in (in accounts under system prefs)

set launchdelay to 5 -- change this as required to customize the number of seconds before the first item launches
set itemdelay to 5 -- change this as required to customize the number of seconds between launches

tell application "Finder"
	activate
	set launchitemsfolder to (path to preferences folder as string) & "staggeredlaunchitems"
	set theItems to list folder launchitemsfolder without invisibles
	delay launchdelay
	repeat with x from 1 to (the number of files of folder launchitemsfolder)
		-- set thefile to (launchitemsfolder & ":" & (file x of folder launchitemsfolder)) as string
		set thefile to (file x of folder launchitemsfolder) as string
		do shell script "open " & quoted form of POSIX path of thefile
		delay 2
	end repeat
end tell
quit

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of nxnw
nxnw
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial