• 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
Do shell script error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do shell script error


  • Subject: Do shell script error
  • From: "Richard @ Beaver Promotions" <email@hidden>
  • Date: Fri, 12 Feb 2010 11:54:38 +0000

Hullo,

Anyone able to fix the below? do shell script refuses to write the file to disk.  I think its not handling the double quote marks incorrectly.

Thanks in advance.

------
Rikki

--TEMP
set centredetails to {"centrename", "forename surname", "addressline1", "addressline2", "addressline3", "addressline4", "addressline5", "post code", "02389239349", "email@hidden"}

set fullname to words of item 2 of centredetails
if (count of items in fullname) is greater than 2 then
set middlename to item 2 of fullname
set surname to item 3 of fullname


else
if (count of items in fullname) is 2 then
set surname to item 2 of fullname
else
set surname to ""
end if
end if

set forename to item 1 of fullname

set outputstring to "|S0233|,|Customer|,||,||,|" & forename & "|,|" & surname & "|,|" & surname & "|,|" & item 9 of centredetails & "|,||,|" & item 10 of centredetails & "|,||,||,|Centre Leader|,||,|1|,||,||,|Their Website|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|" & item 1 of centredetails & "|,|" & item 1 of centredetails & "|,|" & item 2 of centredetails & "|,|" & item 3 of centredetails & "|,|" & item 4 of centredetails & "|,|" & item 5 of centredetails & "|,|" & item 6 of centredetails & "|,|" & item 7 of centredetails & "|,||GB||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,"


set outputstring to my findAndReplace("|", quote, outputstring)


do shell script "/bin/echo " & quoted form of outputstring & " & >> ~/desktop/test.txt"

outputstring


on findAndReplace(tofind, toreplace, theString)
set ditd to text item delimiters
set text item delimiters to tofind
set textItems to text items of theString
set text item delimiters to toreplace
if (class of theString is string) then
set res to textItems as string
else -- if (class of TheString is Unicode text) then
set res to textItems as Unicode text
end if
set text item delimiters to ditd
return res
end findAndReplace
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Reply to Answer to Mounted Network Drives
  • Next by Date: How to export a folder action?
  • Previous by thread: Re: Automator-users digest: Folder Contents
  • Next by thread: How to export a folder action?
  • Index(es):
    • Date
    • Thread