Re: Reading key values in info.plist file iOS or Mac using XML library?

2020-11-12 Thread matthias rebbe via use-livecode
Are you using the xml library for that?
Anyway, would you like to share your handler?

Matthias

-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 13.11.2020 um 02:29 schrieb Paul Dupuis via use-livecode 
> :
> 
> I have an on standaloneSaved handler that reads and writes an updated 
> info.plist for my standalone that adds additional document types since the 
> standalone builder only allows a single document type.
> 
> On 11/12/2020 7:30 PM, matthias rebbe via use-livecode wrote:
>> Hi,
>> 
>> does anyone know if it is possible to use the xml library to read values 
>> from an info.plist file?
>> 
>> 
>> Regards,
>> 
>> Matthias
>> 
>> 
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>> 
>> 
>> ___
>> 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


___
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: Reading key values in info.plist file iOS or Mac using XML library?

2020-11-12 Thread Paul Dupuis via use-livecode
I have an on standaloneSaved handler that reads and writes an updated 
info.plist for my standalone that adds additional document types since 
the standalone builder only allows a single document type.


On 11/12/2020 7:30 PM, matthias rebbe via use-livecode wrote:

Hi,

does anyone know if it is possible to use the xml library to read values from 
an info.plist file?


Regards,

Matthias


-
Matthias Rebbe
Life Is Too Short For Boring Code


___
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: Reading key values in info.plist file iOS or Mac using XML library?

2020-11-12 Thread matthias rebbe via use-livecode
-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 13.11.2020 um 01:43 schrieb Bob Sneidar via use-livecode 
> :
> 
> It is certainly possible! But depending on the complexity of the xml document 
> it may not be easy. I’ve posted before that I attempted to work with an 
> exported XML document from a Toshiba Copier’s Templates (scan presets), but 
> the document was mindbogglingly complex. One issue I ran into is keys which 
> have the same name, so trying to convert the xml to an array failed just on 
> that score. Without knowing what the structure of the XML is supposed to be, 
> a data dictionary for the XML document as it were, I may as well be reading 
> the output of Data’s positronic interface. 
> 

the .plist file contains several entry with same names (string and key)

e.g.

CFBundleDevelopmentRegion
English
CFBundleDisplayName
mOTP
CFBundleName
mOTP


So it seems that is  then not possible to use the xml library. Anyway i will 
read the values using line offset
put line lineoffset("CFBundleDisplayName",tPlist)+1 into 

which then "returns" the string value of CFBundleDisplayName one line below. 
This will work as long as the line with the  value is 
directly after the line with the .. values. 


Thanks.






> Bob S
> 
> 
>> On Nov 12, 2020, at 4:30 PM, matthias rebbe via use-livecode 
>>  wrote:
>> 
>> Hi,
>> 
>> does anyone know if it is possible to use the xml library to read values 
>> from an info.plist file?
>> 
>> 
>> Regards,
>> 
>> Matthias 
>> 
>> 
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>> 
>> 
>> ___
>> 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

___
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: Reading key values in info.plist file iOS or Mac using XML library?

2020-11-12 Thread Bob Sneidar via use-livecode
It is certainly possible! But depending on the complexity of the xml document 
it may not be easy. I’ve posted before that I attempted to work with an 
exported XML document from a Toshiba Copier’s Templates (scan presets), but the 
document was mindbogglingly complex. One issue I ran into is keys which have 
the same name, so trying to convert the xml to an array failed just on that 
score. Without knowing what the structure of the XML is supposed to be, a data 
dictionary for the XML document as it were, I may as well be reading the output 
of Data’s positronic interface. 

Bob S


> On Nov 12, 2020, at 4:30 PM, matthias rebbe via use-livecode 
>  wrote:
> 
> Hi,
> 
> does anyone know if it is possible to use the xml library to read values from 
> an info.plist file?
> 
> 
> Regards,
> 
> Matthias 
> 
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
> 
> 
> ___
> 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


Reading key values in info.plist file iOS or Mac using XML library?

2020-11-12 Thread matthias rebbe via use-livecode
Hi,

does anyone know if it is possible to use the xml library to read values from 
an info.plist file?


Regards,

Matthias 


-
Matthias Rebbe
Life Is Too Short For Boring Code


___
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: How do I shorten this script? Use 'repeat with'?

2020-11-12 Thread William de Smet via use-livecode
I added 'the name of grc "k1" to the script and now it works.
Thanks!

set the loc of grc "k1" to cardWidth/2,cardHeight/2
put the name of grc "k1" into tPrevious
repeat with x = 2 to 5
put "k" & x into tName
set the topleft of grc tName to (item 1 of topright of grc tPrevious -1,
item 2 of topright of grc tPrevious)
put tName into tPrevious
end repeat


greetings,

William




Op do 12 nov. 2020 om 15:14 schreef William de Smet :

> Yes, two variables must be the way!
>
> Your suggestion however throws an error (no such object).
>
> greetings,
>
> William
>
>
>
>
>
> Op do 12 nov. 2020 om 14:57 schreef :
>
>> You could use two variables like tName and tPrevious
>>
>> set the loc of grc "k1" to cardWidth/2,cardHeight/2
>> put ”k1” into tPrevious
>> repeat with i = 2 to 5
>>put ”k” & i into tName
>>set the topleft of grc tName to the topright of grc tPrevious
>>put tName into tPrevious
>> end repeat
>>
>> Coding out of my head so reserve for mistakes!
>>
>> :-Håkan
>> On 12 Nov 2020, 14:50 +0100, William de Smet via use-livecode <
>> use-livecode@lists.runrev.com>, wrote:
>>
>> Hi there,
>>
>> Another question today.
>> How do I shorten this script?
>> 
>> set the loc of grc "k1" to cardWidth/2,cardHeight/2
>> set the topleft of grc "k2" to (item 1 of topright of grc "k1" -1, item 2
>> of topright of grc "k1")
>> set the topleft of grc "k3" to (item 1 of topright of grc "k2" -1, item 2
>> of topright of grc "k2")
>> set the topleft of grc "k4" to (item 1 of topright of grc "k3" -1, item 2
>> of topright of grc "k3")
>> set the topleft of grc "k5" to (item 1 of topright of grc "k4" -1, item 2
>> of topright of grc "k4")
>> 
>>
>> I know I should use 'repeat with' but I am stuck.
>> repeat with x = 2 to 4
>> put "k" & x into tName
>> set the topleft of grc tName to (item 1 of topright of. grc? ,
>> item
>> 2 of topright of grc ...?)
>> end repeat
>>
>>
>> Any help is appreciated!
>>
>>
>>
>> greetings,
>>
>> William
>> ___
>> 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


How do I shorten this script? Use 'repeat with'?

2020-11-12 Thread William de Smet via use-livecode
Hi there,

Another question today.
How do I shorten this script?

set the loc of grc "k1" to cardWidth/2,cardHeight/2
set the topleft of grc "k2" to (item 1 of topright of grc "k1" -1, item 2
of topright of grc "k1")
set the topleft of grc "k3" to (item 1 of topright of grc "k2" -1, item 2
of topright of grc "k2")
set the topleft of grc "k4" to (item 1 of topright of grc "k3" -1, item 2
of topright of grc "k3")
set the topleft of grc "k5" to (item 1 of topright of grc "k4" -1, item 2
of topright of grc "k4")


I know I should use 'repeat with' but I am stuck.
repeat with x = 2 to 4
put "k" & x into tName
set the topleft of grc tName to (item 1 of topright of. grc? , item
2 of topright of grc ...?)
end repeat


Any help is appreciated!



greetings,

William
___
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: Best way to add an image to an oval graphic?

2020-11-12 Thread William de Smet via use-livecode
Thanks all for directing me into a different approach!

greetings,

William




Op wo 11 nov. 2020 om 19:19 schreef Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com>:

> Using the backgroundPattern seems intuitive, but read the fine print:
> image dimensions have very specific requirements, and not heeding those
> can yield unpredictable results.
>
> Earlier this year I had a project that used backgroundPattern as a way
> to use the graphic shape to mask an image.  It worked well in most
> circumstances, with a satisfying range of images sizes - until it didn't.
>
> We eventually found some images that would render at a fraction of
> actual size, tiling across.
>
> I had to ditch it and find another approach, which led to the thread
> here a few months ago about keyhole effect.
>
> The result of that is you can use a graphic placed on top of an image as
> a mark, with the graphic's backgroundColor set to black and the ink set
> to blendDstIn.
>
> That combo will give you a lot of flexibility for centering and even
> resizing your masking graphic over the image.
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   
>   ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> 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