has anyone had any luck using a regular expression within an ASOC project?
I wrote an AS script that returns a list by using a regular expression. I would like to populate a text field in my ASOC project with the list from my applescript script. I copied and pasted the script into the ASOC project and the project stopped working right at the regular expression. Here’s the chunk of code that has the regex:
tell application "AppleScript Editor"
repeat with i from 1 to pageOneCount
set fileName to item i of adFolderContents
set my singleVersion_Field to "hi" as text ----I just used this to see where my text field stopped getting populated...it works here but stops when I move it below the next line-----
set adCounties to find text "01_" & "[A|a|J|j|L|l|M|m]+" & "([A-Z|a-z]*)(\\(([A-Z|a-z]?)|([A-Z|a-z]))*" in fileName with regexp and string result
--to remove the 01 from the variable
set adCounties to adCounties as text
set AppleScript's text item delimiters to "_"
set adCounties to text item 2 of adCounties
--display dialog adCounties
set AppleScript's text item delimiters to ""
set multipleAdVersions to count of items in adCounties
--display dialog multipleAdVersions
try
if multipleAdVersions is greater than 2 then
--display dialog multipleAdVersions
set divisionType to item 1 of adCounties
--display dialog divisionType
repeat with i from 1 to multipleAdVersions
set multipleAdCount to item (i + 2) of adCounties
--set adCounties to divisionType & multipleAdCount
set multiAdCount to divisionType & multipleAdCount as text
--display dialog multiAdCount
set end of adVersionList to multiAdCount & return as text
end repeat
end if
end try
if multipleAdVersions is less than 3 then
set singleAdVersion to items 1 thru 2 of adCounties as text
--display dialog singleAdVersion
set end of adVersionList to adCounties & return as text
end if
end repeat
end tell
As always, any help would be greatly appreciated!