• 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: Works in 10.5; -1719 Error in 10.7
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Works in 10.5; -1719 Error in 10.7


  • Subject: Re: Works in 10.5; -1719 Error in 10.7
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 04 Nov 2011 10:22:22 +1100

On 04/11/2011, at 9:07 AM, Rick Gordon wrote:

Does anyone have some input?

I'm trying to think of a nice way to say that it's an awful way to do things...

Ignoring the fact that it doesn't seem to do what you describe, parsing stuff using terms like "word" is fraught with danger. It should probably be treated as XML and done that way, but it's the sort of thing text item delimiters makes very simple:

set theData to "<?xml version=\"1.0\"?>
[...]
</ncx>
"

set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"\" playOrder=\""}
set theDataItems to text items of theData
set newData to item 1 of theDataItems
set theDataItems to rest of theDataItems
set AppleScript's text item delimiters to {"\""}
repeat with i from 1 to count of theDataItems
set newData to newData & "\" playOrder=\"" & i & "\"" & (text items 2 thru -1 of item i of theDataItems) as text
end repeat
set AppleScript's text item delimiters to oldDelims
return newData

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: Works in 10.5; -1719 Error in 10.7
      • From: Rick Gordon <email@hidden>
References: 
 >Works in 10.5; -1719 Error in 10.7 (From: Rick Gordon <email@hidden>)

  • Prev by Date: Works in 10.5; -1719 Error in 10.7
  • Next by Date: Re: Works in 10.5; -1719 Error in 10.7
  • Previous by thread: Works in 10.5; -1719 Error in 10.7
  • Next by thread: Re: Works in 10.5; -1719 Error in 10.7
  • Index(es):
    • Date
    • Thread