Strange one, new name extensions not recognized

G’day

In our incoming mail, we often have attachments without extensions.

I’d like to give them a unique extension name that can be checked later.

I can attach the name extension, but the script can’t read it later on.

If I give it an extension such as ‘pict’ then it’s fine, but we want it to be unique.

I’ve tried ‘training’ Graphic Converter to recognize the extension, via the ‘Open with’ in the ‘get info’ box, to no avail.

Is there anything I can do to fix this?

Regards

Santa


global TheSuffix
global TheFileTempName
property NewExtension : "grco"
set holding_folder to "Leopard:Users:brianchristmas:desktop:Mail Printing Folder:Temporary Printing:2008-04-22 082552Z"
tell application "Finder"
	try
		set name extension of (files of folder holding_folder whose name extension is missing value) to NewExtension
	end try
end tell
tell application "Finder"
	get every item of desktop -- to refresh finder
	repeat with theItem in (get files of folder holding_folder)
		set TheFileTempName to theItem's name
		set TheSuffix to theItem's name extension
		display dialog TheFileTempName & "   " & TheSuffix
		if TheSuffix = "" then beep
	end repeat
end tell

Model: intel iMac
Browser: Safari 525.18
Operating System: Mac OS X (10.5)

Hi Santa,

what’s about to change the name of the file(s)


global TheSuffix
global TheFileTempName
property NewExtension : "grco"
set holding_folder to ((path to desktop as text) & "Mail Printing Folder:Temporary Printing:2008-04-22 082552Z")
tell application "Finder"
	repeat with oneFile in (get files of folder holding_folder whose name extension is missing value)
		try
			set name of contents of oneFile to (get name of oneFile & "." & NewExtension)
		end try
	end repeat
end tell
tell application "Finder"
	get every item of desktop -- to refresh finder
	repeat with theItem in (get files of folder holding_folder)
		set TheFileTempName to theItem's name
		set TheSuffix to theItem's name extension
		display dialog TheFileTempName & "   " & TheSuffix
		if TheSuffix = "" then beep
	end repeat
end tell

G’day Stefan

Thanks for trying, but it doesn’t work.

Still reads as a null string in the ‘Set the suffix’ line

Regards

Santa

Model: intel iMac
Browser: Safari 525.18
Operating System: Mac OS X (10.5)