Re: Selecting files of type zip
Re: Selecting files of type zip
- Subject: Re: Selecting files of type zip
- From: Yvan KOENIG <email@hidden>
- Date: Thu, 16 Apr 2009 14:59:49 +0200
Le 16 avr. 2009 à 13:49, Axel Luttgens a écrit :
Le 16 avr. 09 à 13:20, Sutapalli Satyanarayana a écrit :
I am using the following statement to display a file choose
dialog, where user is permitted to select only zip files. But
"ZIP" is not a valid file type. Can some one tell me what is the
valid type for ZIP files.
Hello Satyam,
Even if "info for" from Standard Additions tends to be obsoleted, I
nevertheless lazily ran
info for (choose file)
from Script Editor and selected a zipped file created with the
Finder's "Compress..." menu item.
Here's an excerpt of the returned record:
{ ... kind:"Archive dans un fichier ZIP", file type:" file
creator:" type identifier:"public.zip-archive", ... }
It might prove useful to experiment with various zip files so as to
catch every possible cases.
set theItems to POSIX path of (choose file with prompt "Select an
zip file:" of type {"ZIP"} default location (path to desktop))
As suggested by above result, this one works here:
choose file of type {"public.zip-archive"}
Hello
Which operating system are you using ?
Under 10.4.11, for an archive created by the Finder the returned UTI
is: "com.pkware.zip-archive"
It seems that the UTI are far from being universal !
tell application "System Events"
get properties of disk item "Macintosh HD:Users:yvan_koenig:Desktop:
2merge - copie.pages.zip"
{package folder:false, visible:true, volume:"Macintosh HD",
kind:"ZIP archive", URL:"file://localhost/Users/yvan_koenig/Desktop/
2merge - copie.pages.zip", size:4.4427E+4, modification date:date
"vendredi 30 janvier 2009 17:03:29", busy status:false, name:"2merge
- copie.pages.zip", path:"Macintosh HD:Users:yvan_koenig:Desktop:
2merge - copie.pages.zip", creator type:missing value, class:file,
version:"", displayed name:"2merge - copie.pages.zip", name
extension:"zip", type identifier:"com.pkware.zip-archive", file
type:missing value, product version:"", id:{-100, 4053554},
stationery:false, creation date:date "vendredi 30 janvier 2009
16:51:08", physical size:4.5056E+4, POSIX path:"/Users/yvan_koenig/
Desktop/2merge - copie.pages.zip", container:folder "Macintosh
HD:Users:yvan_koenig:Desktop:"}
end tell
tell current application
info for file "Macintosh HD:Users:yvan_koenig:Desktop:2merge -
copie.pages.zip"
{name:"2merge - copie.pages.zip", creation date:date "vendredi 30
janvier 2009 16:51:08", modification date:date "vendredi 30 janvier
2009 17:03:29", icon position:{0, 0}, size:4.4427E+4, folder:false,
alias:false, package folder:false, visible:true, extension
hidden:false, name extension:"zip", displayed name:"2merge -
copie.pages.zip", default application:alias "Macintosh
HD:System:Library:CoreServices:BOMArchiveHelper.app:", kind:"ZIP
archive", file type:"file creator:"type identifier:"com.pkware.zip-
archive", locked:false, busy status:false, short version:"", long
version:""}
end tell
Yvan KOENIG (from FRANCE jeudi 16 avril 2009 14:59:42)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden