use to work in system 9, will not work in OSX, any ideas ?

This Script would Create Master Folders on Server In the Job Folder, would take the “Customer Name” from the Job Folder with a dialog box ask the “Job Number”, name the new folder with (“Job Number” + “Customer Name”) then create all the sub folders. Stops at the 1st alias. Does OSX handel alias diffrently?
Please Help

--create folder, name=frontmost window, path to frontmost window
tell application "Finder"
	activate
	set vTargetWindow to name of front window
	set vTargetLocation to container of window vTargetWindow as alias --fails here use to work in system 9, will not work in OSX, any ideas ?
	set vJobNum to text returned of (display dialog "Enter job number for
client " & vTargetWindow & ":" default answer "")
	set vNewFolderName to vJobNum & "_" & vTargetWindow
	set vNewJobFolder to (make new folder at vTargetLocation with properties {name:vNewFolderName}) as alias
	make new folder at vNewJobFolder with properties {name:"App_Pages"}
	make new folder at vNewJobFolder with properties {name:"Customer_Files"}
	set vLastFourDigits to text 3 thru 6 of vJobNum
	set vFontsFolder to "Fonts_" & vLastFourDigits
	make new folder at vNewJobFolder with properties {name:vFontsFolder}
	make new folder at vNewJobFolder with properties {name:"Hi_Res"}
	make new folder at vNewJobFolder with properties {name:"Old_Versions"}
	make new folder at vNewJobFolder with properties {name:"Support_Files"}
	open vNewJobFolder
	set current view of window 1 to name
end tell

Hi, NiteOwl.

I haven’t actually tested your script but, at a quick glance, I notice one or two things that might need changing.

Instead of: set vTargetLocation to container of window vTargetWindow as alias, try:

set vTargetLocation to target of window vTargetWindow as alias

Instead of: set current view of window 1 to name, try:

set current view of window 1 to list view set sort column of list view options of window 1 to name column
If any other tweaks are required, just yell. :slight_smile:

I’ve had a chance today to look at this more closely, NiteOwl. (It was way past my bedtime last night.)

Since the above suggestions seem to do the trick (assuming I’ve interpreted your aims correctly), the revised script would look something like this:

tell application "Finder"
	activate
	set vTargetWindow to name of front window
	set vTargetLocation to target of window vTargetWindow as alias
	set vJobNum to text returned of (display dialog "Enter job number for client " & vTargetWindow & ":" default answer "")
	set vNewFolderName to vJobNum & "_" & vTargetWindow
	set vNewJobFolder to (make new folder at vTargetLocation with properties {name:vNewFolderName}) as alias
	make new folder at vNewJobFolder with properties {name:"App_Pages"}
	make new folder at vNewJobFolder with properties {name:"Customer_Files"}
	set vLastFourDigits to text 3 thru 6 of vJobNum
	set vFontsFolder to "Fonts_" & vLastFourDigits
	make new folder at vNewJobFolder with properties {name:vFontsFolder}
	make new folder at vNewJobFolder with properties {name:"Hi_Res"}
	make new folder at vNewJobFolder with properties {name:"Old_Versions"}
	make new folder at vNewJobFolder with properties {name:"Support_Files"}
	open vNewJobFolder
	set current view of window 1 to list view
	set sort column of list view options of window 1 to name column
end tell

Just for little variety, this should also do pretty much the same thing:

tell application "Finder"
	activate
	tell (get target of front window)
		set client_name to name
		set job_num to text returned of (display dialog "Enter job number for client " & client_name & ":" default answer "")
		tell (make new folder at it with properties {name:job_num & "_" & client_name})
			repeat with folder_name in {"App_Pages", "Customer_Files", "Fonts_" & ¬
				job_num's text 3 thru 6, "Hi_Res", "Old_Versions", "Support_Files"}
				make new folder at it with properties {name:folder_name}
			end repeat
			tell its window to set {current view, sort column of its list view options} to {list view, name column}
			open
		end tell
	end tell
end tell