• 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: file type in OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file type in OS X


  • Subject: Re: file type in OS X
  • From: Martin Michel <email@hidden>
  • Date: Sun, 24 Mar 2002 13:34:07 +0100

Hi,

I would use code as follows, because "entire contents" does often not work properly (the script is a short version of my "iTunes-O-Mat"):

****

property changedFiles : 0

on run
with timeout of 6000 seconds
set changedFiles to 0
set theFileList to (choose folder with prompt ,
"Bitte wdhlen Sie einen Ordner aus:") as list
repeat with theFile in theFileList
File_or_Folder(theFile)
end repeat
if changedFiles > 0 then
tell application "Finder"
activate
display dialog ,
("Es wurden " & changedFiles as string) & " Dateien erfolgreich umgewandelt." buttons {"Super"} default button 1 with icon note giving up after 10
end tell
end if
end timeout
end run


on open theFileList
with timeout of 6000 seconds
set changedFiles to 0
repeat with theFile in theFileList
my File_or_Folder(theFile)
end repeat
if changedFiles > 0 then
tell application "Finder"
activate
display dialog ,
("Es wurden " & changedFiles as string) & " Dateien erfolgreich umgewandelt." buttons {"Super"} default button 1 with icon note giving up after 10
end tell
end if
end timeout
end open


on File_or_Folder(theFile)
set theInfo to info for theFile
if folder of theInfo then
tell application "Finder"
set FolderList to every item of theFile
end tell
repeat with theFolder in FolderList
set theFolder to theFolder as alias
my File_or_Folder(theFolder)
end repeat
else
my ProcessIt(theFile)
end if
end File_or_Folder


on ProcessIt(theFile)
tell application "Finder"
set changedFiles to changedFiles + 1
set creator type of theFile to "hook"
set file type of theFile to "MPG3"
end tell
end ProcessIt


****


Am Sonntag den, 24. Mdrz 2002, um 13:12, schrieb Applescript User Lewis:

tell application "Finder"
set FolderContents to get entire contents of FolderContents
repeat with i from 1 to count FolderContents
set f to item i of FolderContents
set MyFile to name of f as text
if file type of f is not "fold" then

This generates and error in OS X. I'v also tried if (f's file type is not "fold").

It works in 9. I need to process each file in the folder and then I process the folders to process their files, etc.


-- ___________________________________________________________________________
| applescript@ & "southgaylord.com"| Unix is very user friendly. It's just |
| I frankly do not believe Micro- | picky about who its friends are. |
| soft has the user's interests at | I want a party where all the women wear|
| heart, or even in mind. | new dresses and the men all drink beer.|
---------------------------------------------------------------------------
_______________________________________________
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.

References: 
 >file type in OS X (From: Applescript User Lewis <email@hidden>)

  • Prev by Date: Re: [Back ON] Finding folder from its id
  • Next by Date: Re: [Back ON] Finding folder from its id
  • Previous by thread: file type in OS X
  • Next by thread: Re: Eudora scripts
  • Index(es):
    • Date
    • Thread