Re: How do I get variables to go into HTML code?
Re: How do I get variables to go into HTML code?
- Subject: Re: How do I get variables to go into HTML code?
- From: Jim Krenz via AppleScript-Users <email@hidden>
- Date: Wed, 27 Jan 2021 09:10:20 -0800
Thank you Ralph, Denis and Steven!
Vey helpful all!
> On Jan 27, 2021, at 9:04am, Steven Mills via AppleScript-Users
> <email@hidden> wrote:
>
> On Jan 27, 2021, at 10:54:38, Jim Krenz via AppleScript-Users
> <email@hidden> wrote:
>>
>> I have two variables that I want to get into a line of HTML code. Any ideas
>> on what I am doing wrong?
>>
>> display dialog "Enter the note's title:" default answer "Title" with icon 1
>> set vTitle to text returned of the result
>>
>> display dialog "Enter the note's body:" default answer "Body" with icon 1
>> set vBody to text returned of the result
>>
>> set vNote to "<h1>vTitle</h1>vBody"
>
> set text item delimiters to {"vTitle"}
> set t to every text part of vNote
> set text item delimiters to {vTitle}
> set vTitle to t as text
>
> set text item delimiters to {"vBody"}
> set t to every text part of vBody
> set text item delimiters to {vBody}
> set vBody to t as text
>
> OR (much easier):
>
> set vNote to "<h1>" & vTitle & "</h1>" & vBody
>
>> tell application "Notes"
>> activate
>> tell default account to tell folder "Notes"
>> make new note with properties {body:vNote}
>> end tell
>> end tell
>
> --
> Steve Mills
> Drummer, Mac geek
>
> _______________________________________________
> 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
_______________________________________________
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