NEWBIE: 'drop' file on non-scriptable application

I have this app named ‘extension cleaner’ which removes the extension (if there is one) and sets the internal creator code (if there is none) - BTW What are extensions good for?

I want a folder script and when a new file is added, I want to ‘drop’ it on this non-scriptable application (in /applications/utilities/)

Thanks,
Dominik

Hey Dominik,

We hope you like our new BBS. :cool:

Where did you get “extension cleaner”? Was it off ScriptBuilders? Or from elsewhere? The only reason I ask this, if it’s a script, you might be able to modify it to do what you want. If you haven’t yet, be sure to check out ScriptBuilders as there may already be a solution there.

File Exensions weren’t so important on Mac OS 9 and before, however you very much need them on Mac OS X. That is how the system tells what a file is.

I’m sure someone here will be able to help you right away with this. I just noticed the file extension and name, which peeked my interest. Check out ScriptBuilders, as there may be something that will come close to working for you, and also try a search here too. :smiley:

You’ll need the SetFile command to set the file creator type with this script. It’s included with the Developer Tools.

property fileCreator : "????"
property SetFilePath : "/Developer/Tools/SetFile"

on adding folder items to thisFolder after receiving droppedItems
	set thisFolder to quoted form of (POSIX path of thisFolder)
	try
		do shell script "cd " & thisFolder & "; " & SetFilePath & " -c " & fileCreator & " *"
	end try
	
	repeat with thisItem in droppedItems
		get info for thisItem
		copy result to {name:itemName, name extension:ext}
		if ext is not (missing value) then
			try
				set itemName to quoted form of itemName
				do shell script "cd " & thisFolder & "; mv " & itemName & " \"`echo " & itemName & " | sed s_\\." & ext & "__`\""
			on error errorMsg
				display dialog errorMsg buttons "Cancel" default button 1
			end try
		end if
	end repeat
end adding folder items to

Model: Mac mini
AppleScript: 1.10
Browser: Safari 412
Operating System: Mac OS X (10.4)