File size and type
File size and type
- Subject: File size and type
- From: Hicham Laoudi <email@hidden>
- Date: Tue, 13 May 2003 11:30:08 -0400
I am new to AppleScript and AppleScript Studio and I am running into a
problem. I have an AppleScript Studio app and basically, all I want it
to do is when I drag and drop a file (can be an image, PDF, movie ..)
from the desktop, is to display the size and the type of the file. I
am including the code below.
on awake from nib theObject
tell theObject to register drag types {"file", "file names", "font",
"image", "pdf", "pict image", "pdf"}
end awake from nib
on drop theObject drag info dragInfo
(*Add your script here.*)
set dataTypes to types of pasteboard of dragInfo
say "1"
if "file names" is in dataTypes then
say "2"
set preferred type of pasteboard of dragInfo to "file names"
tell window of theObject
set contents of text field "imageTypeName" to contents of pasteboard
of dragInfo as string
set contents of text field "sizeOfImage" to content of pasteboard of
dragInfo as string
end tell
end if
return true
end drop
Thanks,
HL
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.