Re. Parsing properties in Link- and Internet Shortcut files
@ Matthias Windows 10 with "ink" and "url" files: Thank you very much for the link regarding ".lnk" files. I did not see this before. I will look into it. I also checked the binary format as published by Microsoft. I just answered Hakan without having read your suggestion. ) Sorry that I did not read your message before. Regarding the empty files (maybe they could just not be read in LC for whatever reason): Unfortunately, I have deleted them all. They had assembled for years and I extracted their links with the Batch and stored the links in a database. Testing with different browsers dragging the Internet links, for the moment there is no problem reading with such ".url" files. So, the problem may have be very specific to my system and may not need further attention. If I still find such file then I will it send to you. No problem. Thanks to all here for attending Roland ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Parsing properties in Link- and Internet Shortcut files
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 wrote: > On macOS URL link files are stored as a plist-file like: > > http://www.apple.com/DTDs/PropertyList-1.0.dtd";> > > > URL > https://lessons.livecode.com/ > > > > 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 < > use-livecode@lists.runrev.com>, 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: 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 > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Mandatory for new Andorid apps on Play
For users of android some needed changes are mandatory, perhaps these should again be updated in LC: Upcoming Google Play and Android deadlines Updated Real-Money Gambling, Games, and Contests policy On March 1, we’re expanding the number of countries where you can publish licensed real-money gambling apps and introducing new requirements for gamified loyalty programs. Approval required for background location access If your app uses location in the background, start the approval process by completing the permissions declaration from the App content page (Policy > App content) in Google Play Console. New apps submitted after April 16, 2020 need approval to access background location. Apps published before April 16, 2020 need approval by March 29. August 2021: New apps must target at least Android 11 (API level 30). <-IMPORTANT New apps and games must publish with the Android App Bundle. <---IMPORTANT New apps using Play Billing must use Billing Library version 3 or newer. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: HTML internal to stack - best practices
Håkan, Thanks for the detailed response. I’ll take some time and work through the lessons and examples you recommended. Brian > On Feb 26, 2021, at 8:25 AM, ha...@exformedia.se wrote: > > Found this old mail, but no answer?! Maybe just me, but here goes. > > So to your questions: > > Happy Coding! > > :-Håkan > On 13 Feb 2021, 19:20 +0100, Brian K. Duck via use-livecode > , wrote: ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Parsing properties in Link- and Internet Shortcut files
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 > : > > 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: 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 > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Parsing properties in Link- and Internet Shortcut files
On macOS URL link files are stored as a plist-file like: http://www.apple.com/DTDs/PropertyList-1.0.dtd";> URL https://lessons.livecode.com/ 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 , 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: 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 > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: HTML internal to stack - best practices
Found this old mail, but no answer?! Maybe just me, but here goes. LiveCode has a strong connection between the browser and the LiveCode engine as you can call LiveCode handlers from within your JavaScript and call JavaScript from within your LiveCode handlers. You can also detect clicks on links, when pages load in the browser etc. But there are some quirks we need to know. a .The Browser widget runs kind of on its own. If you save something from an HTML form in a JavaScript variable this is not automagically transfered to LiveCode and vice versa. b. The browser widget ”takes over” the rect where it displays the web page and you can thus not overlay LiveCode controls on top of the browser. We can kind of fake this but might be good to know! So to your questions: 1) How you store the HTML doesn’t matter! IF you stor it in a property, field, variable or file is not important. Doing: ‘set the htmlText of widget ”browser" to …' will be the same as long the stuff you add evaluates to some (HTML) text. If it is a file it might be better to just set the url of the widget though. 2) The short answer is: no. You can include an HTML-file that loads CSS and JavaScript as a normal web page would do. But remember that you can’t link to some CSS that only resides within LiveCode. You can only link to a file. But there is nothing stopping you from within LiveCode create the HTML, CSS and JavaScript on the fly. Output the CSS and JavaScript to temporary files (that you link to in your HTML!) and then set the htmlText of the widget. Or save out all three files and then set the url. If you want to build the page progressively from LiveCode you can do that also. BUT you need to either keep a copy of the HTML code in LiveCode that you edit and then reset the htmlText of the widget OR you can prepare some JavaScript functions that you can call from within LiveCode that in turn manipulates the DOM. 3) If you still are talking about the browser widget there are some lessons at https://lessons.livecode.com but I can agree that the material might need some updates as has been discussed here on the list before. Also take a look at the Dictionary. In the left column there you can find ”browser”. Click on that and you will focus on browser related stuff. There are some good things in the Dictionary! Happy Coding! :-Håkan On 13 Feb 2021, 19:20 +0100, Brian K. Duck via use-livecode , wrote: > I’m looking to understand, find references, and hopefully *examples* of a > stack with html, css, JavaScript, JSON and JavaScript libraries that are > stored internal to the stack. > Some files must be modified by the user, others are untouched by user data, > but included via