Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8133 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Alright,

I have an applescript that I want to search for and make changes to a dynamic list of files. The list itself is generated by filemaker, in the following format:

"Item A

Item B

Item C

Item D"

Now, what I need, is to convert this into a list object in Applescript. That is, I need to be able to, for example, say Open Item 1 of List X. Is there anyway to parse a carriage return delimited list to a list in Applescript? I tried converting it into a string formatted like the string versions of applescript lists:

{"Item 1","Item 2","Item 3"}

and then just saying get cell as list, but this just returns a list with one item, that is the string displayed above.

Thoughts? Is there an easier way to have applescript refer to individual elements of the list than making it into an applescript list object? I could theoretically have the script talk to filemaker every time it needs the next list item, but that would be Mucho Slow!

Thanks!

Posted

try

set theText to "Item A

Item B

Item C

Item D"

set oldDelim to AppleScript's text item delimiters

set AppleScript's text item delimiters to return

set theList to text items of theText

set AppleScript's text item delimiters to oldDelim

This topic is 8133 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.