• 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
making a script into a droplet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

making a script into a droplet


  • Subject: making a script into a droplet
  • From: "Feldman, Don" <email@hidden>
  • Date: Thu, 9 Aug 2001 14:47:01 -0400

Hello List

I wrote a script to check a job folder and go through all the the files and
folders within it checking for a list of file types. It then creates a
scriptable text editor file with the file path on the first line and listing
the file types I'm interested on the next lines. Eventually I am goingto try
to write the information into fields of a Filemaker Pro document, another
program I don't know. I borrowed from Bill Briggs Primer article on
recurrsion (thank a lot, it is very good) to figure out how to do it and it
seem to work OK.

Then I thought it would be nice to be able to process a bunch of folders at
the same time so I tried making it into a droplet. There is something I
don't seem to understand about how to do. I put an on run handler in it
which I think works and a on open droplet handler in it which doen't work.
Anybody got any suggestions?


on open folderList
set allFiles to folderList --probably wasted step
parseFiles(allFiles)
end open


on run
set finalData to {}
set folderList to (choose folder)
parseFiles(folderList)
end run


on parseFiles(allFiles)

dumpFiles(allFiles)
set theTypes to result

set Fname to a reference to folderList as string
set oldDelims to text item delimiters of AppleScript
set text item delimiters of AppleScript to {":"}
set FLocation to the Fname
set Fname to the (text item -2 of Fname)
set text item delimiters of AppleScript to oldDelims
set Fname to Fname & " Record"

------------------------------
set finalList to ""
set Quark to "+class XDOC;"
set QuarkFlag to true
set PDF to "+class PDF ;"
set PDFFlag to true
set MSWORD1 to "+class W8BN;"
set Word1Flag to true
set MSWORD2 to "+class WDBN;"
set Word2Flag to true
set PAGEMAKER1 to "+class ALB4;"
set Pagemaker1Flag to true
set PAGEMAKER2 to "+class ALD4;"
set Pagemaker2Flag to true
set FRAMEMAKER1 to "+class fm;"
set Framemaker1Flag to true
set FRAMEMAKER2 to "+class FASL;"
set Framemaker2Flag to true

repeat with y from 1 to count of theTypes
set FinalOne to item y of theTypes as text
if FinalOne = Quark and QuarkFlag = true then
set finalList to finalList & "Quark" & return
set QuarkFlag to false
else
if FinalOne = PDF and PDFFlag = true then
set finalList to finalList & "PDF" & return
set PDFFlag to false
else
if FinalOne = MSWORD1 and Word1Flag = true
then
set finalList to finalList & "Word1"
& return
set Word1Flag to false
else
if FinalOne = MSWORD2 and Word2Flag
= true then
set finalList to finalList &
"Word2" & return
set Word2Flag to false
else
if FinalOne = PAGEMAKER1 and
Pagemaker1Flag = true then
set finalList to
finalList & "PageMaker1" & return
set Pagemaker1Flag
to false
else
if FinalOne =
PAGEMAKER2 and Pagemaker2Flag = true then
set
finalList to finalList & "PageMaker2" & return
set
Pagemaker2Flag to false
else
if FinalOne
= FRAMEMAKER1 and Framemaker1Flag = true then
set
finalList to finalList & "FrameMaker1" & return
set
Framemaker1Flag to false
else
if
FinalOne = FRAMEMAKER2 and Framemaker2Flag = true then

set finalList to finalList & "FrameMaker2" & return

set Framemaker2Flag to false
end
if
end if
end if
end if
end if
end if
end if
end if
end repeat

tell application "Scriptable Text Editor"
make new document with properties {name:Fname}
set paragraph 1 of document Fname to "The Location is at " &
FLocation & return
set paragraph 2 of document Fname to finalList
end tell
------------------------------

end parseFiles


on dumpFiles(whatsPassed)

tell application "Finder"
set another to the file type of every item of whatsPassed
whose kind is not "folder"
set folderContents to (every item of whatsPassed)
repeat with anItem in folderContents
my dumpFiles(anItem)
end repeat
set my finalData to my finalData & another
end tell
end dumpFiles


  • Follow-Ups:
    • Re: making a script into a droplet
      • From: Bill Briggs <email@hidden>
  • Prev by Date: Re: Why doesn't this simple script work?
  • Next by Date: Re: Files in a Folder
  • Previous by thread: RE: Screen height and width
  • Next by thread: Re: making a script into a droplet
  • Index(es):
    • Date
    • Thread