Parsing properties in Link- and Internet Shortcut files

classic Classic list List threaded Threaded
50 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
I am on Windows 10 (but answer will apply to MacOS as well).

I am trying to read the URL property of a file that I create simply
dragging-dropping the Internet address from my browser to the Desktop and
then storing this file. There are thousands now!!!

Some of such files are readable text files with the readable content
"[internetshortcut], URL: xxx etc." -- but most Internet shortcut files on
Windows with the invisible .url or .ink extension are empty when trying to
read with using a text editor or opening them in LiveCode.

In such Windows file's there is a property url:<link> that contains the web
address. It is visible when opening using the right mouse button (context
menu) and then selecting the "properties" item. When double-clicking such
file, the default browser will open and open the web page directed to.

But I want to read this URL property as text directly and use it from
within LiveCode.

I assume that these Internet shortcuts store the URL information not in the
file itself, or I just cannot get to this information.

I found one batch file script that promises such a solution. Such batch
text file can be called through the SHELL() command and will then execute.
It has the file extension ".bat".

#-- START BATCH SCRIPT
echo off
setlocal enableextensions enabledelayedexpansion
pushd %1
for %%F in (%1\*.url) do (
   echo %%~dpnxF
   call :findurl "%%~dpnxF"
)
popd
goto end
:findurl inputfile
set url=
for /f "tokens=2 delims==" %%i in ('findstr URL %1') do set url=%%i
echo %url%
echo -----
:end
#-- END BATCH SCRIPT

Unfortunately, my knowledge of such batch scripts is very limited.

I get error messages when calling the batch file through the shell
function. Maybe there is someone here who can interpret this script? To me
it would be sufficient to simply call shell("location of the file and file
name of the url-file .. shell commands") and receive back the URL property
as text. Or is there any other way to get to this information?

Since LC is cross-platform, such solution also would be nice to have for
OSX and Linux?

Regards, Roland
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
On macOS URL link files are stored as a plist-file like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>URL</key>
        <string>https://lessons.livecode.com/</string>
</dict>
</plist>

So you can open the file as text and then parse the content.

:-Håkan
On 12 Feb 2021, 18:55 +0100, R.H. via use-livecode <[hidden email]>, wrote:

> I am on Windows 10 (but answer will apply to MacOS as well).
>
> I am trying to read the URL property of a file that I create simply
> dragging-dropping the Internet address from my browser to the Desktop and
> then storing this file. There are thousands now!!!
>
> Some of such files are readable text files with the readable content
> "[internetshortcut], URL: xxx etc." -- but most Internet shortcut files on
> Windows with the invisible .url or .ink extension are empty when trying to
> read with using a text editor or opening them in LiveCode.
>
> In such Windows file's there is a property url:<link> that contains the web
> address. It is visible when opening using the right mouse button (context
> menu) and then selecting the "properties" item. When double-clicking such
> file, the default browser will open and open the web page directed to.
>
> But I want to read this URL property as text directly and use it from
> within LiveCode.
>
> I assume that these Internet shortcuts store the URL information not in the
> file itself, or I just cannot get to this information.
>
> I found one batch file script that promises such a solution. Such batch
> text file can be called through the SHELL() command and will then execute.
> It has the file extension ".bat".
>
> #-- START BATCH SCRIPT
> echo off
> setlocal enableextensions enabledelayedexpansion
> pushd %1
> for %%F in (%1\*.url) do (
> echo %%~dpnxF
> call :findurl "%%~dpnxF"
> )
> popd
> goto end
> :findurl inputfile
> set url=
> for /f "tokens=2 delims==" %%i in ('findstr URL %1') do set url=%%i
> echo %url%
> echo -----
> :end
> #-- END BATCH SCRIPT
>
> Unfortunately, my knowledge of such batch scripts is very limited.
>
> I get error messages when calling the batch file through the shell
> function. Maybe there is someone here who can interpret this script? To me
> it would be sufficient to simply call shell("location of the file and file
> name of the url-file .. shell commands") and receive back the URL property
> as text. Or is there any other way to get to this information?
>
> Since LC is cross-platform, such solution also would be nice to have for
> OSX and Linux?
>
> Regards, Roland
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode


I tried here to find an "empty" .url file, but w/o success. My .url files i have collected over the years on my Windows VM are all textfiles. If you could provide a link to such an empty one, i would be really interested to see that.

Regarding the .lnk files, which seem to be in a binary form, did you already see this discussion here?
https://stackoverflow.com/questions/397125/reading-the-target-of-a-lnk-file-in-python

Someone posted a Python script there which is able to read the target of an .lnk file.
May be that is an alternative.

Matthias




-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 12.02.2021 um 18:53 schrieb R.H. via use-livecode <[hidden email]>:
>
> I am on Windows 10 (but answer will apply to MacOS as well).
>
> I am trying to read the URL property of a file that I create simply
> dragging-dropping the Internet address from my browser to the Desktop and
> then storing this file. There are thousands now!!!
>
> Some of such files are readable text files with the readable content
> "[internetshortcut], URL: xxx etc." -- but most Internet shortcut files on
> Windows with the invisible .url or .ink extension are empty when trying to
> read with using a text editor or opening them in LiveCode.
>
> In such Windows file's there is a property url:<link> that contains the web
> address. It is visible when opening using the right mouse button (context
> menu) and then selecting the "properties" item. When double-clicking such
> file, the default browser will open and open the web page directed to.
>
> But I want to read this URL property as text directly and use it from
> within LiveCode.
>
> I assume that these Internet shortcuts store the URL information not in the
> file itself, or I just cannot get to this information.
>
> I found one batch file script that promises such a solution. Such batch
> text file can be called through the SHELL() command and will then execute.
> It has the file extension ".bat".
>
> #-- START BATCH SCRIPT
> echo off
> setlocal enableextensions enabledelayedexpansion
> pushd %1
> for %%F in (%1\*.url) do (
>   echo %%~dpnxF
>   call :findurl "%%~dpnxF"
> )
> popd
> goto end
> :findurl inputfile
> set url=
> for /f "tokens=2 delims==" %%i in ('findstr URL %1') do set url=%%i
> echo %url%
> echo -----
> :end
> #-- END BATCH SCRIPT
>
> Unfortunately, my knowledge of such batch scripts is very limited.
>
> I get error messages when calling the batch file through the shell
> function. Maybe there is someone here who can interpret this script? To me
> it would be sufficient to simply call shell("location of the file and file
> name of the url-file .. shell commands") and receive back the URL property
> as text. Or is there any other way to get to this information?
>
> Since LC is cross-platform, such solution also would be nice to have for
> OSX and Linux?
>
> Regards, Roland
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Dear Hakan

Thank you very much for this information. As you may have noticed, I had
solved the problem using the Batch file the same day I posted the question
for Windows.

For Mac, I had no idea and your input is highly appreciated. For Linux I
also do not know.

Actually, these special files on Windows (with the hidden ".url" extension)
are usually fine to read simply using URL("binfile:" & tFilePath ). My
problem has be with a number of files that returned empty for unknown
reasons.

It is a more difficult to parse "shortcut" or ".lnk" files in Windows since
they have a binary format and to extract relevant information requires
knowing the detailed file structure and reading relevant bytes or trying a
hack to extract the readable links they represent without (which I did so
far). Also for these files, Windows hides the extension ".lnk", but it is
visible when calling files (tFolderpath) in LiveCode.

Happy weekend
Roland

On Fri, Feb 26, 2021 at 2:52 PM <[hidden email]> wrote:

> On macOS URL link files are stored as a plist-file like:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "
> http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> <key>URL</key>
> <string>https://lessons.livecode.com/</string>
> </dict>
> </plist>
>
> So you can open the file as text and then parse the content.
>
> :-Håkan
> On 12 Feb 2021, 18:55 +0100, R.H. via use-livecode <
> [hidden email]>, wrote:
>
> I am on Windows 10 (but answer will apply to MacOS as well).
>
> I am trying to read the URL property of a file that I create simply
> dragging-dropping the Internet address from my browser to the Desktop and
> then storing this file. There are thousands now!!!
>
> Some of such files are readable text files with the readable content
> "[internetshortcut], URL: xxx etc." -- but most Internet shortcut files on
> Windows with the invisible .url or .ink extension are empty when trying to
> read with using a text editor or opening them in LiveCode.
>
> In such Windows file's there is a property url:<link> that contains the web
> address. It is visible when opening using the right mouse button (context
> menu) and then selecting the "properties" item. When double-clicking such
> file, the default browser will open and open the web page directed to.
>
> But I want to read this URL property as text directly and use it from
> within LiveCode.
>
> I assume that these Internet shortcuts store the URL information not in the
> file itself, or I just cannot get to this information.
>
> I found one batch file script that promises such a solution. Such batch
> text file can be called through the SHELL() command and will then execute.
> It has the file extension ".bat".
>
> #-- START BATCH SCRIPT
> echo off
> setlocal enableextensions enabledelayedexpansion
> pushd %1
> for %%F in (%1\*.url) do (
> echo %%~dpnxF
> call :findurl "%%~dpnxF"
> )
> popd
> goto end
> :findurl inputfile
> set url=
> for /f "tokens=2 delims==" %%i in ('findstr URL %1') do set url=%%i
> echo %url%
> echo -----
> :end
> #-- END BATCH SCRIPT
>
> Unfortunately, my knowledge of such batch scripts is very limited.
>
> I get error messages when calling the batch file through the shell
> function. Maybe there is someone here who can interpret this script? To me
> it would be sufficient to simply call shell("location of the file and file
> name of the url-file .. shell commands") and receive back the URL property
> as text. Or is there any other way to get to this information?
>
> Since LC is cross-platform, such solution also would be nice to have for
> OSX and Linux?
>
> Regards, Roland
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
@ Hagan
@ Matthias

I posted my hack on the forum also mentioning our discussion here:

https://forums.livecode.com/viewtopic.php?f=7&t=35458

Of course, if some one has clean solution to actually read Window's binary
".lnk" file, it would be another lesson to enjoy. Unfortunately, I cannot
do it now because of time constraints. But the solution works (for me).

Roland
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Matthias,

I ran into your send email stack with TSNet
yesterday while looking for a solution to
some of my livecode email problems.  
After filling in the test fields to send a message
and hitting the send button, it told me the
message was sent, but upon checking my
email it was clear that it never got sent.

I know you put that stack together in 2017
so some things have changed since then
including macOS.  

Have you tested the stack recently at all
and do you know if it still works?  

If so, the other possibility is that I have
somehow not filled in one of the fields properly.  
Could you supply a better example using
gmail smtp settings or something similar,
or update the documentation?

Thanks,

Rick


> On Feb 26, 2021, at 10:26 AM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
>
>
> I tried here to find an "empty" .url file, but w/o success. My .url files i have collected over the years on my Windows VM are all textfiles. If you could provide a link to such an empty one, i would be really interested to see that.
>
> Regarding the .lnk files, which seem to be in a binary form, did you already see this discussion here?
> https://stackoverflow.com/questions/397125/reading-the-target-of-a-lnk-file-in-python
>
> Someone posted a Python script there which is able to read the target of an .lnk file.
> May be that is an alternative.
>
> Matthias
>
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Matthias,

I ran into your send email stack with TSNet
yesterday while looking for a solution to
some of my livecode email problems.  
After filling in the test fields to send a message
and hitting the send button, it told me the
message was sent, but upon checking my
email it was clear that it never got sent.

I know you put that stack together in 2017
so some things have changed since then
including macOS.  

Have you tested the stack recently at all
and do you know if it still works?  

If so, the other possibility is that I have
somehow not filled in one of the fields properly.  
Could you supply a better example using
gmail smtp settings or something similar,
or update the documentation?

Thanks,

Rick


> On Feb 26, 2021, at 10:26 AM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
>
>
> I tried here to find an "empty" .url file, but w/o success. My .url files i have collected over the years on my Windows VM are all textfiles. If you could provide a link to such an empty one, i would be really interested to see that.
>
> Regarding the .lnk files, which seem to be in a binary form, did you already see this discussion here?
> https://stackoverflow.com/questions/397125/reading-the-target-of-a-lnk-file-in-python
>
> Someone posted a Python script there which is able to read the target of an .lnk file.
> May be that is an alternative.
>
> Matthias
>
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


-
Matthias Rebbe
Life Is Too Short For Boring Code


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Rick,

do you mean the stack lcMailAndFtp.livecode?

The original stack was created by Charles Warwick, the developer of the tsNet externals.
If i remember correctly, i added the FTP part or so and put that modified stack as lcMailAndFtp.livecode online.

You could look here for a newer version (1.2) of Charles mail sample stack.
https://www.techstrategies.com.au/tsnet-resources/

Although the version 1.2 of the mail stack is more current then the one from my site, it still is a little bit "outdated".
There is a new command in LC available called mimeEncodeAsMIMEEmail which would make some of the code in the sample stack obsolete if it would be used. But the sample stack from Techstrategies should still work.

If you still have problems you can contact me also directly at   matthias (at) m-r-d.de

Regards,

Matthias

> Am 01.03.2021 um 17:49 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> I ran into your send email stack with TSNet
> yesterday while looking for a solution to
> some of my livecode email problems.  
> After filling in the test fields to send a message
> and hitting the send button, it told me the
> message was sent, but upon checking my
> email it was clear that it never got sent.
>
> I know you put that stack together in 2017
> so some things have changed since then
> including macOS.  
>
> Have you tested the stack recently at all
> and do you know if it still works?  
>
> If so, the other possibility is that I have
> somehow not filled in one of the fields properly.  
> Could you supply a better example using
> gmail smtp settings or something similar,
> or update the documentation?
>
> Thanks,
>
> Rick
>
>
>> On Feb 26, 2021, at 10:26 AM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>>
>>
>> I tried here to find an "empty" .url file, but w/o success. My .url files i have collected over the years on my Windows VM are all textfiles. If you could provide a link to such an empty one, i would be really interested to see that.
>>
>> Regarding the .lnk files, which seem to be in a binary form, did you already see this discussion here?
>> https://stackoverflow.com/questions/397125/reading-the-target-of-a-lnk-file-in-python
>>
>> Someone posted a Python script there which is able to read the target of an .lnk file.
>> May be that is an alternative.
>>
>> Matthias
>>
>>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



-
Matthias Rebbe
Life Is Too Short For Boring Code


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Parsing properties in Link- and Internet Shortcut files

Mark Wieder via use-livecode
Hi Matthias,

Yes, I meant lcMailAndFtp.livecode.

I’m looking at https://www.techstrategies.com.au/tsnet-resources/ <https://www.techstrategies.com.au/tsnet-resources/> now.

I’ll get back to you later after absorbing what I can understand.

Thanks!

Rick



> On Mar 1, 2021, at 12:38 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> Rick,
>
> do you mean the stack lcMailAndFtp.livecode?
>
> The original stack was created by Charles Warwick, the developer of the tsNet externals.
> If i remember correctly, i added the FTP part or so and put that modified stack as lcMailAndFtp.livecode online.
>
> You could look here for a newer version (1.2) of Charles mail sample stack.
> https://www.techstrategies.com.au/tsnet-resources/
>
> Although the version 1.2 of the mail stack is more current then the one from my site, it still is a little bit "outdated".
> There is a new command in LC available called mimeEncodeAsMIMEEmail which would make some of the code in the sample stack obsolete if it would be used. But the sample stack from Techstrategies should still work.
>
> If you still have problems you can contact me also directly at   matthias (at) m-r-d.de
>
> Regards,
>
> Matthias
>
>> Am 01.03.2021 um 17:49 schrieb Rick Harrison via use-livecode <[hidden email]>:
>>
>> Hi Matthias,
>>
>> I ran into your send email stack with TSNet
>> yesterday while looking for a solution to
>> some of my livecode email problems.  
>> After filling in the test fields to send a message
>> and hitting the send button, it told me the
>> message was sent, but upon checking my
>> email it was clear that it never got sent.
>>
>> I know you put that stack together in 2017
>> so some things have changed since then
>> including macOS.  
>>
>> Have you tested the stack recently at all
>> and do you know if it still works?  
>>
>> If so, the other possibility is that I have
>> somehow not filled in one of the fields properly.  
>> Could you supply a better example using
>> gmail smtp settings or something similar,
>> or update the documentation?
>>
>> Thanks,
>>
>> Rick
>>
>>
>>> On Feb 26, 2021, at 10:26 AM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>>
>>>
>>>
>>> I tried here to find an "empty" .url file, but w/o success. My .url files i have collected over the years on my Windows VM are all textfiles. If you could provide a link to such an empty one, i would be really interested to see that.
>>>
>>> Regarding the .lnk files, which seem to be in a binary form, did you already see this discussion here?
>>> https://stackoverflow.com/questions/397125/reading-the-target-of-a-lnk-file-in-python
>>>
>>> Someone posted a Python script there which is able to read the target of an .lnk file.
>>> May be that is an alternative.
>>>
>>> Matthias
>>>
>>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Version 1.2 of the mail stack

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Matthias,

I tried it out and the stack works fine.

Now I am in the process of trying to convert it
so I can use the process directly in my LC Server.

Of course field values now become variable values.

Everything seems fine except:

put mimeEncodeFieldAsMIMEMultipartDocument(the long id of field "email_message") into tBody

How do I get he long id of my VariableEmailMessage into tBody?

Ideas?

Rick


> On Mar 1, 2021, at 12:38 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> Rick,
>
> do you mean the stack lcMailAndFtp.livecode?
>
> The original stack was created by Charles Warwick, the developer of the tsNet externals.
> If i remember correctly, i added the FTP part or so and put that modified stack as lcMailAndFtp.livecode online.
>
> You could look here for a newer version (1.2) of Charles mail sample stack.
> https://www.techstrategies.com.au/tsnet-resources/
>
> Although the version 1.2 of the mail stack is more current then the one from my site, it still is a little bit "outdated".
> There is a new command in LC available called mimeEncodeAsMIMEEmail which would make some of the code in the sample stack obsolete if it would be used. But the sample stack from Techstrategies should still work.
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
Hi Rick,

if i recall it correctly i used the templatefield for that in LC server.

So set the text of the templatefield and then use that in the mimeEncodeFieldAsMIMEMultipartDocument.

e.g.
put "test" into the templatefield
put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody


LC Server does not include the Mime library, so you'll need to copy the complete Mime library script to your web server and include it in your script.

It's late here and i am off for some sleep now. So do not wonder when i reply later.

-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 02.03.2021 um 00:33 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> I tried it out and the stack works fine.
>
> Now I am in the process of trying to convert it
> so I can use the process directly in my LC Server.
>
> Of course field values now become variable values.
>
> Everything seems fine except:
>
> put mimeEncodeFieldAsMIMEMultipartDocument(the long id of field "email_message") into tBody
>
> How do I get he long id of my VariableEmailMessage into tBody?
>
> Ideas?
>
> Rick
>
>
>> On Mar 1, 2021, at 12:38 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> Rick,
>>
>> do you mean the stack lcMailAndFtp.livecode?
>>
>> The original stack was created by Charles Warwick, the developer of the tsNet externals.
>> If i remember correctly, i added the FTP part or so and put that modified stack as lcMailAndFtp.livecode online.
>>
>> You could look here for a newer version (1.2) of Charles mail sample stack.
>> https://www.techstrategies.com.au/tsnet-resources/
>>
>> Although the version 1.2 of the mail stack is more current then the one from my site, it still is a little bit "outdated".
>> There is a new command in LC available called mimeEncodeAsMIMEEmail which would make some of the code in the sample stack obsolete if it would be used. But the sample stack from Techstrategies should still work.
>>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
Hi Matthias,

Sorry, but I have never needed to mess with libraries before this.

Where do I get the complete Mime library script?

I tried looking in the Project Browser for version
1.2 of the mail stack but all I could see was
com.livecode.library.mime and tsNetLibUrl
for choices.  When I open either I get a blank
window and when I try to look for script in
the stack or card it shows me nothing.
 
Is there a LiveCode lesson on this anywhere?

Thanks,

Rick


> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> Hi Rick,
>
> if i recall it correctly i used the templatefield for that in LC server.
>
> So set the text of the templatefield and then use that in the mimeEncodeFieldAsMIMEMultipartDocument.
>
> e.g.
> put "test" into the templatefield
> put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody
>
>
> LC Server does not include the Mime library, so you'll need to copy the complete Mime library script to your web server and include it in your script.
>
> It's late here and i am off for some sleep now. So do not wonder when i reply later.
>
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Matthais,

It’s been so long since I have used the project browser
I forgot that one has to click on the number of lines
of code to see the actual code. LOL

Ok, so which one do I want?

Rick
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Matthias,

Ok, I only see mimeEncodeFieldAsMIMEMultipartDocument in
com.livecode.library.mime and not in the TsNetLibUrl, so I
guess that answers that question.

If I’m incorrect somehow, please let me know.

Thanks,

Rick

> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> mimeEncodeFieldAsMIMEMultipartDocument

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
I would copy the complete file mime.livecodescript to the server.
The file can be found in the Extensions folder either in the app bundle (macOS) or  the Livecode program folder under program files (Windows).

In your script  use 'start using...." to use the library
e.g.
start using  "mime.livecodescript"

put "test" into the templatefield
put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody




Regarding tsNet:
I am at HostM and i am using LivecodeServer Business in my accounts.
HostM has LivecodeServer Community installed by default for every account.
But if a customer can proof the purchase/subscription of an Indy or Business License, they even install the Indy or Business version of Livecode Server for the that customer accounts.

In the past it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET.



Regards,
Matthias



Matthias Rebbe
-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 02.03.2021 um 17:56 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> Ok, I only see mimeEncodeFieldAsMIMEMultipartDocument in
> com.livecode.library.mime and not in the TsNetLibUrl, so I
> guess that answers that question.
>
> If I’m incorrect somehow, please let me know.
>
> Thanks,
>
> Rick
>
>> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> mimeEncodeFieldAsMIMEMultipartDocument
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
Hi Matthias,

I managed to find mime.livecodescript.

What folder do I need to put it into on my macOS Catalina LC Server?

Thanks,

Rick

> On Mar 2, 2021, at 12:55 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> I would copy the complete file mime.livecodescript to the server.
> The file can be found in the Extensions folder either in the app bundle (macOS) or  the Livecode program folder under program files (Windows).
>
> In your script  use 'start using...." to use the library
> e.g.
> start using  "mime.livecodescript"
>
> put "test" into the templatefield
> put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody
>
>
>
>
> Regarding tsNet:
> I am at HostM and i am using LivecodeServer Business in my accounts.
> HostM has LivecodeServer Community installed by default for every account.
> But if a customer can proof the purchase/subscription of an Indy or Business License, they even install the Indy or Business version of Livecode Server for the that customer accounts.
>
> In the past it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET.
>
>
>
> Regards,
> Matthias
>
>
>
> Matthias Rebbe
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
>
>> Am 02.03.2021 um 17:56 schrieb Rick Harrison via use-livecode <[hidden email]>:
>>
>> Hi Matthias,
>>
>> Ok, I only see mimeEncodeFieldAsMIMEMultipartDocument in
>> com.livecode.library.mime and not in the TsNetLibUrl, so I
>> guess that answers that question.
>>
>> If I’m incorrect somehow, please let me know.
>>
>> Thanks,
>>
>> Rick
>>
>>> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>>
>>> mimeEncodeFieldAsMIMEMultipartDocument
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
When i did test it some time ago, i've put it in the same folder where the livecode server script that used the library was located.


-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 02.03.2021 um 21:05 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> I managed to find mime.livecodescript.
>
> What folder do I need to put it into on my macOS Catalina LC Server?
>
> Thanks,
>
> Rick
>
>> On Mar 2, 2021, at 12:55 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> I would copy the complete file mime.livecodescript to the server.
>> The file can be found in the Extensions folder either in the app bundle (macOS) or  the Livecode program folder under program files (Windows).
>>
>> In your script  use 'start using...." to use the library
>> e.g.
>> start using  "mime.livecodescript"
>>
>> put "test" into the templatefield
>> put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody
>>
>>
>>
>>
>> Regarding tsNet:
>> I am at HostM and i am using LivecodeServer Business in my accounts.
>> HostM has LivecodeServer Community installed by default for every account.
>> But if a customer can proof the purchase/subscription of an Indy or Business License, they even install the Indy or Business version of Livecode Server for the that customer accounts.
>>
>> In the past it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET.
>>
>>
>>
>> Regards,
>> Matthias
>>
>>
>>
>> Matthias Rebbe
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>>
>>> Am 02.03.2021 um 17:56 schrieb Rick Harrison via use-livecode <[hidden email]>:
>>>
>>> Hi Matthias,
>>>
>>> Ok, I only see mimeEncodeFieldAsMIMEMultipartDocument in
>>> com.livecode.library.mime and not in the TsNetLibUrl, so I
>>> guess that answers that question.
>>>
>>> If I’m incorrect somehow, please let me know.
>>>
>>> Thanks,
>>>
>>> Rick
>>>
>>>> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>>>
>>>> mimeEncodeFieldAsMIMEMultipartDocument
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Matthias,

I put mime.livecodescript into the folder with the script that call it.

I put in the start using “mime.livecodescript” statement.

When I run the script, I now get:

Function: error in function handler (tsNetSmtpSync)

which is pointing to:

put tsNetSmtpSync(tURL, tFrom, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult

I do not see this function in mime.livecodescript so where does tsNetSmtpSync hang out?

Is that a part of " it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET”?

Where is that and how do I run it?  Another start using command?

Thanks,

Rick






> On Mar 2, 2021, at 12:55 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> I would copy the complete file mime.livecodescript to the server.
> The file can be found in the Extensions folder either in the app bundle (macOS) or  the Livecode program folder under program files (Windows).
>
> In your script  use 'start using...." to use the library
> e.g.
> start using  "mime.livecodescript"
>
> put "test" into the templatefield
> put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody
>
>
>
>
> Regarding tsNet:
> I am at HostM and i am using LivecodeServer Business in my accounts.
> HostM has LivecodeServer Community installed by default for every account.
> But if a customer can proof the purchase/subscription of an Indy or Business License, they even install the Indy or Business version of Livecode Server for the that customer accounts.
>
> In the past it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET.
>
>
>
> Regards,
> Matthias
>
>
>
> Matthias Rebbe
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
>
>> Am 02.03.2021 um 17:56 schrieb Rick Harrison via use-livecode <[hidden email]>:
>>
>> Hi Matthias,
>>
>> Ok, I only see mimeEncodeFieldAsMIMEMultipartDocument in
>> com.livecode.library.mime and not in the TsNetLibUrl, so I
>> guess that answers that question.
>>
>> If I’m incorrect somehow, please let me know.
>>
>> Thanks,
>>
>> Rick
>>
>>> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>>
>>> mimeEncodeFieldAsMIMEMultipartDocument
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
it seems tsNet is missing in your installation of Livecode Server.

Please create a folder externals in the folder where livecode server is installed.
Then copy the tsNet external from you Livecode Desktop installation into the newly created externals folder.

That should do.

Regards,


-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 02.03.2021 um 23:10 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Matthias,
>
> I put mime.livecodescript into the folder with the script that call it.
>
> I put in the start using “mime.livecodescript” statement.
>
> When I run the script, I now get:
>
> Function: error in function handler (tsNetSmtpSync)
>
> which is pointing to:
>
> put tsNetSmtpSync(tURL, tFrom, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult
>
> I do not see this function in mime.livecodescript so where does tsNetSmtpSync hang out?
>
> Is that a part of " it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET”?
>
> Where is that and how do I run it?  Another start using command?
>
> Thanks,
>
> Rick
>
>
>
>
>
>
>> On Mar 2, 2021, at 12:55 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>
>> I would copy the complete file mime.livecodescript to the server.
>> The file can be found in the Extensions folder either in the app bundle (macOS) or  the Livecode program folder under program files (Windows).
>>
>> In your script  use 'start using...." to use the library
>> e.g.
>> start using  "mime.livecodescript"
>>
>> put "test" into the templatefield
>> put mimeEncodeFieldAsMIMEMultipartDocument(the long id of the templatefield) into tBody
>>
>>
>>
>>
>> Regarding tsNet:
>> I am at HostM and i am using LivecodeServer Business in my accounts.
>> HostM has LivecodeServer Community installed by default for every account.
>> But if a customer can proof the purchase/subscription of an Indy or Business License, they even install the Indy or Business version of Livecode Server for the that customer accounts.
>>
>> In the past it was mandatory to run  tsInit   first in the Livecode Server script to initialize tsNET.
>>
>>
>>
>> Regards,
>> Matthias
>>
>>
>>
>> Matthias Rebbe
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>>
>>> Am 02.03.2021 um 17:56 schrieb Rick Harrison via use-livecode <[hidden email]>:
>>>
>>> Hi Matthias,
>>>
>>> Ok, I only see mimeEncodeFieldAsMIMEMultipartDocument in
>>> com.livecode.library.mime and not in the TsNetLibUrl, so I
>>> guess that answers that question.
>>>
>>> If I’m incorrect somehow, please let me know.
>>>
>>> Thanks,
>>>
>>> Rick
>>>
>>>> On Mar 1, 2021, at 7:09 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>>>>
>>>> mimeEncodeFieldAsMIMEMultipartDocument
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Version 1.2 of the mail stack

Mark Wieder via use-livecode
Hi Matthias,

What I’m seeing is:

Applications
LiveCode (App)
(Right Click)Show Package Contents
Contents
Tools
Ext
tsNet_INDY_1.4.2 (Folder Full of tsNet stuff)

Do I want the entire folder?

Do I just want:

tsNet.bundle
tsNet.dylib
tsnetliburl.livecodescript

There’s a lot of items.

Thanks,

Rick

> On Mar 2, 2021, at 5:23 PM, matthias rebbe via use-livecode <[hidden email]> wrote:
>
> it seems tsNet is missing in your installation of Livecode Server.
>
> Please create a folder externals in the folder where livecode server is installed.
> Then copy the tsNet external from you Livecode Desktop installation into the newly created externals folder.
>
> That should do.
>
> Regards,

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
123