• 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: Populating a variable from a txt file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Populating a variable from a txt file


  • Subject: Re: Populating a variable from a txt file
  • From: Stan Cleveland <email@hidden>
  • Date: Mon, 13 Feb 2012 17:02:24 -0800

On Feb 13, 2012, at 1:45 PM, email@hidden wrote:

I have a script that controls Phlink and I've set a variable for "banned" phone numbers, like so:

-- variable 'bannedList' contains complete numbers of parties you wish to block
set bannedList to {"9529449920", "2068417623", "9525824774", "6235828680", "3175590000", "7162134578", "3027521422", "2134888236", "3192427355", "3032808689"}

However, I'd like to put them in a text file for ease of entry, like so:
<snip>
and then have them pulled into the bannedList variable.

Hi Marc,

How about this?:
set  bannedList to paragraphs of (read alias "MacHD:Users:stanc:Desktop:PhoneNumbers.txt")

Be sure to avoid putting extra returns to the text file, as they will add unwanted null strings to your bannedList list.

HTH,
Stan C.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Populating a variable from a txt file
      • From: email@hidden
References: 
 >Populating a variable from a txt file (From: email@hidden)

  • Prev by Date: Populating a variable from a txt file
  • Next by Date: Re: Populating a variable from a txt file
  • Previous by thread: Populating a variable from a txt file
  • Next by thread: Re: Populating a variable from a txt file
  • Index(es):
    • Date
    • Thread