Page 1 of 1

Basic Help with Text

Posted: Fri Mar 25, 2016 1:00 am
by Jamie37
Hello,

I cannot get my head around this problem. Basically I have this code below so that when a file is selected from a field, it sets the delimiter to "/" and clears the previous selection. I then press the new selection from another field and it put into the new field after my item delimiter. The problem is that after this I need to also insert "} which finishes the path off for file. However I cannot seem to get what I need to add it to the end after the file selection has been inserted. Below is the code:

Code: Select all

on selectionchanged
   set the itemdelimiter to "/"
   put the hilitedtext of me into gSelectedFile
   put empty into item 6 in fld "Header_files-download"
   put item 1 of gSelectedFile into tSelectedFile
   put tSelectedFile into item 6 in fld "Header_files-download"
   show button "View"
end selectionchanged
This is the text im inserting the new file selection into and need to add the quote and braces to the end:

Code: Select all

{"path":"/apps/h&s app/apps/myapp/THIS TEXT IS CHANGED"}
Hopefully its clear what I mean...

Thanks
Jamie

Re: Basic Help with Text

Posted: Fri Mar 25, 2016 1:26 am
by Simon
How about

Code: Select all

 put tSelectedFile & quote & "}" into item 6 in fld "Header_files-download"
Simon

Re: Basic Help with Text

Posted: Fri Mar 25, 2016 10:53 pm
by Jamie37
Ok thank you Simon, that's great. It is now sorted.

Jamie