• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Identifying the file types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying the file types


  • Subject: Re: Identifying the file types
  • From: Hanaan Rosenthal <email@hidden>
  • Date: Mon, 26 Jan 2004 11:16:00 -0500
  • Organization: Custom Flow Solutions

Hello Takashi,

tell application "System Events"
set firstFilePath to file 1 of photos as alias
end tell
set fileType to file type of (info for firstFilePath)
set nameExt to name extension of (info for firstFilePath)
--test for both file type and name ext of first file:
if fileType is not in {"tiff", "GIF ", "JPEG"} and nameExt is not in {"gif", "jpg",
"tif"} then --add more file types...
--not a picture file...
--Exit
end if

Hanaan
>
> Hi all,
>
> I'm writing a simple drag and drop application that will begin a
> slideshow of the photographs.
> User is supposed to drag a folder containing photos or selections of
> photo files into the application and the application will launch
> GraphicConverter to begin the slideshow.
>
> It's simple enough and I've already got it to work. The thing is, is
> there any reliable way to check whether the files dropped into the
> application are pictures? File extension is not really a reliable way
> to correctly identify the file types and I'm not sure if checking the
> file types or creator type are reliable (do Mac OS X applications still
> keep these information around?)
>
> Anyway, here's a script that I've got so far.
>
> on run
> display dialog "Please drag and drop a folder that contains your
> pictures." buttons {"OK"} default button 1 giving up after 10 with icon
> note
> end run
>
> on open photos
> -- there should some kind of error checking here before going into
> slideshow mode.
>
> tell application "GraphicConverter"
> -- bring the GraphicConverter to the front and begin the
slideshow
> activate
> slideshow photos
> end tell
> end open
>
>
> Thanks,
>
> --
> Takashi Yoshida
> e-mail: email@hidden
>
> [demime 0.98b removed an attachment of type application/pkcs7-
signature which had a name of smime.p7s]
> _______________________________________________
> 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.
_______________________________________________
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.

  • Prev by Date: Re: Scripting Additions 'Read' has stopped reaching EOF?
  • Next by Date: UI Element Inspector
  • Previous by thread: Re: Identifying the file types
  • Next by thread: Getting contents of folder question.
  • Index(es):
    • Date
    • Thread