Setting File Creator & Type

hello,

I’m brand new to AppleScript and I need to create a droplet that will set creator & type. we have a lot of old diskdoubler files, that lost their resource forks. so disk doubler can’t recognize them to expand.

I found some scripts in this forum, that I merged to one. well, my applescript can change the creator, but not the type and I get an error message:


sh: -c line 1: unexpected EOF while looking for matching '"
sh: -c line 2: syntax error: unexpected end of file


this is my script:

on open (theFiles)
repeat with someFile in theFiles
set theFiles to quoted form of POSIX path of someFile
do shell script “/Developer/Tools/SetFile -t DDFL’” & theFiles & "’ " & quoted form of POSIX path of someFile
do shell script “/Developer/Tools/SetFile -c DDAP” & theFiles & "’ " & quoted form of POSIX path of someFile
end repeat
end open

thanks for help in advance!

The script you posted above requires the Developer’s Tools to be installed. Try this instead:

on open the_files
	tell application "System Events"
		repeat with this_file in the_files
			set file type of this_file to "DDFL"
			set creator type of this_file to "DDAP"
		end repeat
	end tell
end open

If you want to use the Developer’s Tools, however, you need to modify your script like so:

on open the_files
	repeat with this_file in the_files
		do shell script "/Developer/Tools/SetFile -t DDFL " & quoted form of POSIX path of this_file
		do shell script "/Developer/Tools/SetFile -c DDAP " & quoted form of POSIX path of this_file
	end repeat
end open

Jon

thank you!