Hung up calling another script

I’m having a very specific issue.

I’ve written a login script for our OS X users that mounts a read only share on a server. Inside this share is a text file based on our computer name and a text file based on the user name. The script starts with the user name and mounts all of the shares in the text file. It then sets up printers based on the information in the computer name text file. By doing this no mater what machine one of our users logs into the servers they need will be setup and they will be connected to the nearest printer. Our IT Dept can modify the text files so that if a new server is added or a new printer is in place all of the users will get these settings automatically. This portion works great.

Our next brilliant idea was to create a smaller script that will run on login on each machine. This script needs to somehow “call” the larger script. The idea is that I can make changes to the larger script and it will instantly take effect for everyone.

I can get the smaller script to mount a different read only share, open the larger script, but then it tries to unmount the share the larger script is stored on (not the same one the text files are on). When the larger script opens it mounts all of the shares but then can’t find the user text file even though just running the script from the server it is able to complete it.

I can’t find a way to tell the smaller script to just include the larger one, to wait for the larger one to complete or any other solution. I realize I’m probably just overlooking something but I’ve been trying for a few days now.

Any suggestions?

Here is basically what we have for the smaller script that would call the larger one.

on run
	set fullserver_name to "smb://yourserver/yourshare"
	set shortserver_name to ":Volumes:yourshare"
	set script_name to shortserver_name & ":thescript" as string
	tell application "Finder"
		try
			mount volume fullserver_name
			run script_name
			eject shortserver_name
		on error the error_message number the error_number
			set error_message to error_message & "	" & error_number
			tell me to display dialog the error_message buttons {"OK"} default button 1 with icon stop
			beep
		end try
	end tell
end run 

I’ve tried saving the larger script as both an application and a run only script.

Does what we’re trying to do even sound possible?

The following command is incomplete: run script_name

This is telling the script to run a string of text (the path to the script file). Try this: run script alias script_name

– Rob

Ahhh,

I guess I’ve overlooked dumber things in other languages.

Between that and a few other code changes I’ve made it seems to be working (although I’m using different servers over a VPN right now so who knows).