Solved

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

Posted on 2010-09-17
2
553 Views
Last Modified: 2012-05-10
(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.
0
Comment
Question by:kimakabane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 12

Expert Comment

by:nxnw
ID: 33827251
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

0
 
LVL 12

Accepted Solution

by:
nxnw earned 500 total points
ID: 33827819
Attached snippet has corrections and tweaks to the applescript. Please use this one (primary issue: the itemdelay variable will not work in the original).
-- this script emulates the 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 10 -- 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"
	set launchitemsfolder to (path to preferences folder as string) & "staggeredlaunchitems"
	delay launchdelay
	repeat with x from 1 to (the number of files of folder launchitemsfolder)
		set thefile to (file x of folder launchitemsfolder) as string
		do shell script "open " & (quoted form of POSIX path of thefile)
		delay itemdelay
	end repeat
end tell
quit

Open in new window

0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question