Re: Populating a variable from a txt file
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
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