I am trying to modify an apple script that gets the file type of a file and then assigns an extension. The problem that I am having is trying to determine when the file has no type.
The script I was using is:
set {fileType, creatorType} to {file type, file creator} of (get info for itemAlias)
if creatorType is "" then -- perform function
I think I must be comparing the variable “creatorType” to the wrong type, but still learning
Any information would be very helpful
Rather than mucking with detection of ascii characters, just coerce the value to unicode and then your existing code will work fine…
set {fileType, creatorType} to {file type, file creator} of (get info for itemAlias)
set creatorType to (creatorType as Unicode text)
if creatorType is "" then
return "Empty String"
else
return creatorType
end if
Thanks for your help, that’s allowed me to move the main problem of assigning extensions to files without creator types using the magic type. It would been alot easier is people just stayed on a Mac instead of Mac to PC to Mac