sharing script with "mkdir -p" creates problems

Hi there.

I have created a script that contains a shell script that is supposed to create a folder on a computer desktop:

on createFolder(nameString)
set macFolderPath to baseFolder & nameString
do shell script "mkdir -p " & quoted form of POSIX path of macFolderPath
return macFolderPath & “:”
end createFolder

This script works fine on my computer as a droplet, but when I share it with other computers, they all give an error because they are looking for my computer’s directory …

Is there a way to reset the mkdir command, or make it forget my computer?

Thanks for any help!

Hi,

the variable baseFolder causes the problem, I guess it’s a hard-coded global variable.
This is a version which works on any computer


on createFolder(nameString)
	set macFolderPath to (path to desktop folder as text) & nameString
	do shell script "mkdir -p " & quoted form of POSIX path of macFolderPath
	return macFolderPath & ":"
end createFolder

Thank you so much “ that fixed my problem!

I had baseFolder defined as “(path to desktop as text)” not as “desktop folder” “ it’s all in the syntax.

Thanks again!