Attaching a job number to a file name

What I need to do have a dialog box “pop” up so the end user can enter a job number then have that number attached to the beginning of each folder name. So far I can make the folders inside of folders no problme. Any help is appericated.

Jason

In the future, please use a more descriptive subject line (e.g, “newbie needs help with dialogs”).

Try this:

set job_number to text returned of (display dialog "Enter the job number:" default answer "" buttons {"Cancel", "OK"} default button 2 with icon 1)

Jon

Maybe this will help get you started.

set j_num to ""
repeat until j_num is not ""
	set dd to (display dialog "Enter a job number." default answer "")
	set j_num to text returned of dd
end repeat

tell application "Finder"
	try
		make new folder at desktop with properties {name:(j_num & "rest of name")}
	on error e
		display dialog e buttons {"OK"} default button 1 with icon 0
	end try
end tell

Edit: Oops, Jon snuck in there while I was coding. :wink:

– Rob

Yeah, I’ve got to be sneaky, Rob. How else am I going to gain ground on the 500 posts you’ve got on me? :wink:

Jon
(Who’s embarrassed every time he uses an emoticon or refers to himself in the third person and terribly punchy from lack of sleep.)

I now need to have that folder made on a Win 2000 server any thoughts?

Jason

I have no experience with servers so I don’t know what’s required. I suppose it’s naive to think that it could be as easy as this:

set j_num to ""
repeat until j_num is not ""
	set dd to (display dialog "Enter a job number." default answer "")
	set j_num to text returned of dd
end repeat

tell application "Finder"
	try
		make new folder at folder "path:to:server_directory:" with properties {name:(j_num & "rest of name")}
	on error e
		display dialog e buttons {"OK"} default button 1 with icon 0
	end try
end tell

Thank you…and yet it is just that easy!

Jason