• 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: Using Data From Tab Delimited Text File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Data From Tab Delimited Text File


  • Subject: Re: Using Data From Tab Delimited Text File
  • From: g3pb <email@hidden>
  • Date: Tue, 06 Nov 2001 17:46:54 -0900

-- this should help with getting the URL

(* contents of logfile
www.domain.com name_of_logfile
www.domain2.com name_of_logfile2
*)

property logFile : "iMac:Desktop Folder:logfile"

try
set oldDelimiter to AppleScript's text item delimiters
set AppleScript's text item delimiters to " "
set fRef to ""
set fRef to open for access file logFile
repeat until false
set dLine to read fRef before return
set theURL to text item 1 of dLine
end repeat
set AppleScript's text item delimiters to oldDelimiter
on error errMsg number errNum
-- expect an EOF error
if fRef is not "" then
set AppleScript's text item delimiters to oldDelimiter
close access fRef
end if
end try

-- as for waiting, it seems like that would largely depend on just how long
the app takes and i don't know what all else ... could one app send an
AppleEvent back to an AppleScript???

-- hcir
mailto:email@hidden

> I need to write an Applescript to run a bunch of copies of Web Server Log
> Analysis Programs.
>
> The Web Server Log is broken up by a Perl script and files created in in
> folders corresponding to the domains hosted.
>
> The details of the domains hosted for the purposes of the Logging is kept in
> a Tab Delimited text file in the form:
>
> www.domain.com name_of_logfile
> www.domain2.com name_of_logfile2
>
> and so on...
>
> The name_of_logfile part is not important to the Applescript function, just
> the www.domain.com part as it will form part of the path to the application
> to be run.
>
> The path will be like:
>
> Macintosh HD:Web Server:Web Sites:server_stats:www.domain.com:Application
>
> So I want the script to go to the text file, get the first www.domain.com,
> activate the Application, wait till it is finished, then get the next
> www.domain.com from the text file and activate that Application and so on...
>
> The parts I am having trouble with are:
>
> 1. Getting the www.domin.com information from the text file
>
> 2. Getting the script to wait for the Application to finish before going on.


References: 
 >Using Data From Tab Delimited Text File (From: Les Cavanagh <email@hidden>)

  • Prev by Date: Re: Novice question
  • Next by Date: Re: Using Data From Tab Delimited Text File
  • Previous by thread: Using Data From Tab Delimited Text File
  • Next by thread: Re: Using Data From Tab Delimited Text File
  • Index(es):
    • Date
    • Thread