In Project builder 10.2 I had no problem getting the file type using the ‘info for’ statement.
However in Xcode 10.3 I am having trouble getting the file type.
set infoRecord to (info for theFile)
set x to file type of infoRecord
In the scriptmaker this works OK and in Project Builder 10.2 I got the exact same result as below
tell current application
info for alias "Mac OS 10.3.5:Applications:Safari.app:"
{name:"Safari.app", creation date:date "vrijdag, 5 december 2003 21:00:00", modification date:date "vrijdag, 5 december 2003 21:00:00", icon position:{0, 0}, size:9.13239E+6, folder:true, alias:false, name extension:"app", extension hidden:true, visible:true, package folder:true, file type:"APPL", file creator:"sfri", displayed name:"Safari", kind:"Programma", short version:"1.2.4", long version:"1.2.4, Copyright 2004 Apple Computer, Inc.", bundle identifier:"com.apple.Safari"}
end tell
In Xcode 10.3 the same statements results is this:
{«class hidx»:true, «class kind»:"Application", «class assv»:"1.2.4", name:"Safari.app", «class asct»:"sfri", «class ispk»:true, «class asdr»:true, «class aslv»:"1.2.4, Copyright 2004 Apple Computer, Inc.", file type:"APPL", «class bnid»:"com.apple.Safari", «class asmo»:date "vrijdag, 5 december 2003 21:00:00", size:9.13239E+6, «class asip»:{0, 0}, alias:false, «class dnam»:"Safari", «class nmxt»:"app", «class ascd»:date "vrijdag, 5 december 2003 21:00:00", visible:true}
There is a ‘file type’ in this record but Xcode does not allow me to request for it because it keeps changing the statement ‘file type’ into ‘file kind’
on awake from nib theObject
-- Using the Finder works, but has an unacceptable delay
tell application "Finder"
set infoRecord to (info for theFile)
set x to file type of infoRecord
end tell
-- This results in an error
set infoRecord to (info for theFile)
set x to file kind of infoRecord
end awake from nib
So my question is: How do I get the file type without asking the Finder in Xcode 10.3?
I don’t want this record, I need to have it the way it was in 10.2. Can this be done in 10.3 somehow?
Thanks in advance,
John