Re: Can Lists be put in storage?

2018-10-08 Thread Chris Belanger via 4D_Tech
Sorry, I figured it out. You CAN store it into storage; I just failed to call:

OBJECT SET LIST BY REFERENCE(*;”cbox_UnitTypes”;Storage.lists.list_UnitTypes)

when I worked at converting my work to use Storage.

---

> On Oct 8, 2018, at 11:30 PM, Chris Belanger  wrote:
> 
> I wanted to store some lists into storage.
> 
> I make an entity selection, then create a LIST using a method ORDA_MakeList.
> The lists are made perfectly (outside of Storage).
> 
> This works flawlessly: the resulting list_UnitTypes works correctly as a LIST.
> 
> $col_UnitTypes:=ds.Unit_Type.all().orderBy("Name asc").toCollection("Name";dk 
> with primary key)
> list_UnitTypes:=ORDA_MakeList ($col_UnitTypes;"Name")
> ——
> 
> However, trying to store the LIST in Storage presents a problem:
> 
> $col_UnitTypes:=ds.Unit_Type.all().orderBy("Name asc").toCollection("Name";dk 
> with primary key)
> Use (Storage)
>   If (Storage.lists=Null)
>   Storage.lists:=New shared object
>   End if 
>   Use (Storage.lists)
>   Storage.lists.list_UnitTypes:=ORDA_MakeList 
> ($col_UnitTypes;"Name")
> … other lists …
>   End use 
> End use 
> 
> Now if the list is referred to in any window / process, then it fails.
> Storage.lists.list_UnitTypes will give an INTEGER VALUE, but it list 
> functions cannot work (i.e. do not recognize it as a list).
> 
> ——
> 
> So am I going to have to store entity selections in storage and convert these 
> to lists inside the windows I use them in?
> I was hoping that LISTS would be ‘interprocess’ in the sense that there is a 
> unique number given to any that are created.
> 
> 
> — thanks, Chris
> 
> p.s.  this is the ORDA_MakeList() method:
>  // ORDA_MakeList(entitySelection;DisplayFieldName) --> list with 
> DisplayFields and __KEYS
> C_COLLECTION($1)
> C_TEXT($2)  // the name of the Display Field
> C_OBJECT($Unit)
> 
> $theList:=New list
> For each ($Unit;$1)
>   APPEND TO LIST($theList;$Unit[$2];$Unit.__KEY)
> End for each 
> 
> $0:=$theList

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Can Lists be put in storage?

2018-10-08 Thread Chris Belanger via 4D_Tech
I wanted to store some lists into storage.

I make an entity selection, then create a LIST using a method ORDA_MakeList.
The lists are made perfectly (outside of Storage).

This works flawlessly: the resulting list_UnitTypes works correctly as a LIST.

$col_UnitTypes:=ds.Unit_Type.all().orderBy("Name asc").toCollection("Name";dk 
with primary key)
list_UnitTypes:=ORDA_MakeList ($col_UnitTypes;"Name")
——

However, trying to store the LIST in Storage presents a problem:

$col_UnitTypes:=ds.Unit_Type.all().orderBy("Name asc").toCollection("Name";dk 
with primary key)
Use (Storage)
If (Storage.lists=Null)
Storage.lists:=New shared object
End if 
Use (Storage.lists)
Storage.lists.list_UnitTypes:=ORDA_MakeList 
($col_UnitTypes;"Name")
… other lists …
End use 
End use 

Now if the list is referred to in any window / process, then it fails.
Storage.lists.list_UnitTypes will give an INTEGER VALUE, but it list functions 
cannot work (i.e. do not recognize it as a list).

——

So am I going to have to store entity selections in storage and convert these 
to lists inside the windows I use them in?
I was hoping that LISTS would be ‘interprocess’ in the sense that there is a 
unique number given to any that are created.


— thanks, Chris

p.s.  this is the ORDA_MakeList() method:
  // ORDA_MakeList(entitySelection;DisplayFieldName) --> list with 
DisplayFields and __KEYS
C_COLLECTION($1)
C_TEXT($2)  // the name of the Display Field
C_OBJECT($Unit)

$theList:=New list
For each ($Unit;$1)
APPEND TO LIST($theList;$Unit[$2];$Unit.__KEY)
End for each 

$0:=$theList
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Notes on converting pictures to v17

2018-10-08 Thread Tim Nevels via 4D_Tech
On Oct 8, 2018, at 11:28 AM, 4d_tech-requ...@lists.4d.com wrote:

> Unexpected discovery - the picture library is still a useful thing!

This is so true. I’m still a big user and believer in the Picture Library. 
There are two big benefits for me:

1. If you are updating your 4D application often and using images on forms, 
it’s convenient to not have to worry about adding and updating image files in 
the Resources folder when you deploy the update. Picture Library is stored in 
the .4DB and .4DC file so you know every image referenced will always be found. 
Just copy the new .4DC and .4DIndy files and you have deployed your application 
update. 

2. If your application is running under 4D Server your 4D Client users benefit 
from the built in 4D Client “download only what I need when I need it” 
architecture. If you use the Resources folder to store all images, and that 
group of images is 300MB in size, 4D Client must download the entire 300MB 
Resources folder at startup when you deploy a new version of your application. 
Could be a a noticeable delay. 

Picture Library works just like methods and forms. Using the Picture Library, 
when an image is needed, 4D Client checks its locally cached resource file to 
see if it exists, if not it download that single image. Not all 300MB of 
images. And if 290MB of images are never needed or used by a particular client 
they never have to download them. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Notes on converting pictures to v17

2018-10-08 Thread Jim Dorrance via 4D_Tech
I prefer to leave images in the resources:images folder so that I can
use apps like Graohic Converter to remove the resource fork and other
things to  optimize the images.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Notes on converting pictures to v17

2018-10-08 Thread Chip Scheide via 4D_Tech
I tried that during my attempts to convert pictures, the results were 
(iF yUo Cee Kaye)d  :)

Ill try in a newer version and see if I can trans fed them backwards

On Mon, 8 Oct 2018 12:00:13 -0400, Randy Jaynes wrote:
> Chip,
> 
> Try this: I know v13 doesn’t have the Transparency constant, so not 
> sure which version of 4D it comes into play, but this was part of one 
> of the conversion routines I ran into a while ago when I had to do 
> this:
> 
> TRANSFORM PICTURE($Pict_G;Transparency;0x00FF)  //convert the 
> WHITE to Transparent  
>   
> Randy
> 
> --
> Randy Jaynes
> Senior Programmer and Customer Support
> 
> http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow 
> Lane • Palisades, NY 10964 
> Please send all email contacts to supp...@printpoint.com 
> 
> 
> 
> 
> 
>> On Oct 8, 2018, at 11:19 AM, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have done this, although in v13.  I found that all my images now have 
>> white backgrounds 
>> any way to fix this without manually editing every single one??
>> 
>> On Mon, 8 Oct 2018 08:12:44 -0700, Kirk Brooks via 4D_Tech wrote:
>>> I'm preparing to move a large, established project from v15 to v17 and
>>> finally had to deal with the pictures. I've been putting this off at least
>>> partly because of just not wanting to deal with this. Turns out it's not
>>> that big a deal, at least for me.
>>> 
>>> When I've just done the conversion to see what happened lots of old forms,
>>> the ones 4D creates, had the dreaded red X in the button icons. Most of my
>>> forms were fine because for a long time I've been using icons from the
>>> resource folder which were already .png. But I still had to do something
>>> about the legacy images.
>>> 
>>> 1) converting the picture library
>>> This was really easy. As numerous folks have pointed out this is where to
>>> start:
>>> 
>>> http://kb.4d.com/assetid=76775
>>> 
>>> I don't have 4D Pack installed any more and didn't see an easy, native way
>>> of determining what kind of file a picture library resource is. But then I
>>> realized I really don't care what they were because I was going to make
>>> them all .png now. So I modified the loop to simply convert all the images
>>> to .png.
>>> 
>>> I did this in the v15 version.
>>> 
>>> 2) the outliers
>>> A number of forms have static images in them. This illustrated the various
>>> strategies 4D has used over the years for building the default forms. I
>>> didn't pay enough attention to determine which versions did what but some
>>> forms have static images as backgrounds that are incompatible and some
>>> don't.
>>> 
>>> I quickly noticed lots of them were named "Picture6". Doing a find in
>>> design located all the forms with "Picture6" and opened each one deleting
>>> the obsolete image. Sometimes the image was OK. None of these forms are
>>> user-facing so they don't really matter but the point is it's easy to find
>>> them and relatively quick to delete them.
>>> 
>>> Bottom line - this wasn't nearly as painful or time consuming a deal as I
>>> feared.
>>> 
>>> Unexpected discovery - the picture library is still a useful thing!
>>> 
>>> I had equated the library with .pict files and stopped paying attention to
>>> it. This isn't the case and the tools for managing what's in the library
>>> are simple to use. You can't edit images directly anymore (that's 
>>> way gone)
>>> but storing .png files is a snap and for me a lot easier than 
>>> managing them
>>> from Resources.
>>> 
>>> It's also easier if you have a large collection of icons but only use a
>>> few. I have a set of icons I like and use but there are hundreds of 
>>> them in
>>> my development resources folder. I don't want to include all of them in
>>> deployed databases so I have this method that loops all the forms and all
>>> the objects making a list of the ones I actually use and then creating a
>>> subset folder of just those icons for shipping. It's a PITA.
>>> 
>>> I am going to be changing that so I'll loop through all the form 
>>> objects as
>>> now but if I refer to a file in my icons folder I'll put a copy of that
>>> icon in the library and change the ref in the object. This way I will be
>>> able to refer to the full icon set during development but not ship it.
>>> 
>>> -- 
>>> Kirk Brooks
>>> San Francisco, CA
>>> ===
>>> 
>>> *We go vote - they go home*
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
>> 

Re: Notes on converting pictures to v17

2018-10-08 Thread Randy Jaynes via 4D_Tech
Chip,

Try this: I know v13 doesn’t have the Transparency constant, so not sure which 
version of 4D it comes into play, but this was part of one of the conversion 
routines I ran into a while ago when I had to do this:

TRANSFORM PICTURE($Pict_G;Transparency;0x00FF)  //convert the WHITE to 
Transparent  

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane • 
Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Oct 8, 2018, at 11:19 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have done this, although in v13.  I found that all my images now have 
> white backgrounds 
> any way to fix this without manually editing every single one??
> 
> On Mon, 8 Oct 2018 08:12:44 -0700, Kirk Brooks via 4D_Tech wrote:
>> I'm preparing to move a large, established project from v15 to v17 and
>> finally had to deal with the pictures. I've been putting this off at least
>> partly because of just not wanting to deal with this. Turns out it's not
>> that big a deal, at least for me.
>> 
>> When I've just done the conversion to see what happened lots of old forms,
>> the ones 4D creates, had the dreaded red X in the button icons. Most of my
>> forms were fine because for a long time I've been using icons from the
>> resource folder which were already .png. But I still had to do something
>> about the legacy images.
>> 
>> 1) converting the picture library
>> This was really easy. As numerous folks have pointed out this is where to
>> start:
>> 
>> http://kb.4d.com/assetid=76775
>> 
>> I don't have 4D Pack installed any more and didn't see an easy, native way
>> of determining what kind of file a picture library resource is. But then I
>> realized I really don't care what they were because I was going to make
>> them all .png now. So I modified the loop to simply convert all the images
>> to .png.
>> 
>> I did this in the v15 version.
>> 
>> 2) the outliers
>> A number of forms have static images in them. This illustrated the various
>> strategies 4D has used over the years for building the default forms. I
>> didn't pay enough attention to determine which versions did what but some
>> forms have static images as backgrounds that are incompatible and some
>> don't.
>> 
>> I quickly noticed lots of them were named "Picture6". Doing a find in
>> design located all the forms with "Picture6" and opened each one deleting
>> the obsolete image. Sometimes the image was OK. None of these forms are
>> user-facing so they don't really matter but the point is it's easy to find
>> them and relatively quick to delete them.
>> 
>> Bottom line - this wasn't nearly as painful or time consuming a deal as I
>> feared.
>> 
>> Unexpected discovery - the picture library is still a useful thing!
>> 
>> I had equated the library with .pict files and stopped paying attention to
>> it. This isn't the case and the tools for managing what's in the library
>> are simple to use. You can't edit images directly anymore (that's way gone)
>> but storing .png files is a snap and for me a lot easier than managing them
>> from Resources.
>> 
>> It's also easier if you have a large collection of icons but only use a
>> few. I have a set of icons I like and use but there are hundreds of them in
>> my development resources folder. I don't want to include all of them in
>> deployed databases so I have this method that loops all the forms and all
>> the objects making a list of the ones I actually use and then creating a
>> subset folder of just those icons for shipping. It's a PITA.
>> 
>> I am going to be changing that so I'll loop through all the form objects as
>> now but if I refer to a file in my icons folder I'll put a copy of that
>> icon in the library and change the ref in the object. This way I will be
>> able to refer to the full icon set during development but not ship it.
>> 
>> -- 
>> Kirk Brooks
>> San Francisco, CA
>> ===
>> 
>> *We go vote - they go home*
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


Re: Notes on converting pictures to v17

2018-10-08 Thread Randy Jaynes via 4D_Tech
Kirk,

There is an easier way.

If you open a copy of your database in v17, and run MSC > Verify Application on 
it, it will point out all the bad form objects for you. The log file will show 
you entries like this in the sections where it is checking your project forms 
and table forms:

PrintPoint Home.Page0.ComponentGroup uses a deprecated picture format: PICT.
PrintPoint Home.Page0.rolloverEstimates uses a deprecated picture format: PICT.
PrintPoint Home.Page0.Picture6 uses a deprecated picture format: PICT.
PrintPoint Home.Page0.Picture7 uses a deprecated picture format: PICT.
 
Saves you from writing any code. :-)

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane • 
Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Oct 8, 2018, at 11:12 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I'm preparing to move a large, established project from v15 to v17 and
> finally had to deal with the pictures. I've been putting this off at least
> partly because of just not wanting to deal with this. Turns out it's not
> that big a deal, at least for me.
> 
> When I've just done the conversion to see what happened lots of old forms,
> the ones 4D creates, had the dreaded red X in the button icons. Most of my
> forms were fine because for a long time I've been using icons from the
> resource folder which were already .png. But I still had to do something
> about the legacy images.
> 
> 1) converting the picture library
> This was really easy. As numerous folks have pointed out this is where to
> start:
> 
> http://kb.4d.com/assetid=76775
> 
> I don't have 4D Pack installed any more and didn't see an easy, native way
> of determining what kind of file a picture library resource is. But then I
> realized I really don't care what they were because I was going to make
> them all .png now. So I modified the loop to simply convert all the images
> to .png.
> 
> I did this in the v15 version.
> 
> 2) the outliers
> A number of forms have static images in them. This illustrated the various
> strategies 4D has used over the years for building the default forms. I
> didn't pay enough attention to determine which versions did what but some
> forms have static images as backgrounds that are incompatible and some
> don't.
> 
> I quickly noticed lots of them were named "Picture6". Doing a find in
> design located all the forms with "Picture6" and opened each one deleting
> the obsolete image. Sometimes the image was OK. None of these forms are
> user-facing so they don't really matter but the point is it's easy to find
> them and relatively quick to delete them.
> 
> Bottom line - this wasn't nearly as painful or time consuming a deal as I
> feared.
> 
> Unexpected discovery - the picture library is still a useful thing!
> 
> I had equated the library with .pict files and stopped paying attention to
> it. This isn't the case and the tools for managing what's in the library
> are simple to use. You can't edit images directly anymore (that's way gone)
> but storing .png files is a snap and for me a lot easier than managing them
> from Resources.
> 
> It's also easier if you have a large collection of icons but only use a
> few. I have a set of icons I like and use but there are hundreds of them in
> my development resources folder. I don't want to include all of them in
> deployed databases so I have this method that loops all the forms and all
> the objects making a list of the ones I actually use and then creating a
> subset folder of just those icons for shipping. It's a PITA.
> 
> I am going to be changing that so I'll loop through all the form objects as
> now but if I refer to a file in my icons folder I'll put a copy of that
> icon in the library and change the ref in the object. This way I will be
> able to refer to the full icon set during development but not ship it.
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Notes on converting pictures to v17

2018-10-08 Thread Chip Scheide via 4D_Tech
I have done this, although in v13.  I found that all my images now have 
white backgrounds 
any way to fix this without manually editing every single one??

On Mon, 8 Oct 2018 08:12:44 -0700, Kirk Brooks via 4D_Tech wrote:
> I'm preparing to move a large, established project from v15 to v17 and
> finally had to deal with the pictures. I've been putting this off at least
> partly because of just not wanting to deal with this. Turns out it's not
> that big a deal, at least for me.
> 
> When I've just done the conversion to see what happened lots of old forms,
> the ones 4D creates, had the dreaded red X in the button icons. Most of my
> forms were fine because for a long time I've been using icons from the
> resource folder which were already .png. But I still had to do something
> about the legacy images.
> 
> 1) converting the picture library
> This was really easy. As numerous folks have pointed out this is where to
> start:
> 
> http://kb.4d.com/assetid=76775
> 
> I don't have 4D Pack installed any more and didn't see an easy, native way
> of determining what kind of file a picture library resource is. But then I
> realized I really don't care what they were because I was going to make
> them all .png now. So I modified the loop to simply convert all the images
> to .png.
> 
> I did this in the v15 version.
> 
> 2) the outliers
> A number of forms have static images in them. This illustrated the various
> strategies 4D has used over the years for building the default forms. I
> didn't pay enough attention to determine which versions did what but some
> forms have static images as backgrounds that are incompatible and some
> don't.
> 
> I quickly noticed lots of them were named "Picture6". Doing a find in
> design located all the forms with "Picture6" and opened each one deleting
> the obsolete image. Sometimes the image was OK. None of these forms are
> user-facing so they don't really matter but the point is it's easy to find
> them and relatively quick to delete them.
> 
> Bottom line - this wasn't nearly as painful or time consuming a deal as I
> feared.
> 
> Unexpected discovery - the picture library is still a useful thing!
> 
> I had equated the library with .pict files and stopped paying attention to
> it. This isn't the case and the tools for managing what's in the library
> are simple to use. You can't edit images directly anymore (that's way gone)
> but storing .png files is a snap and for me a lot easier than managing them
> from Resources.
> 
> It's also easier if you have a large collection of icons but only use a
> few. I have a set of icons I like and use but there are hundreds of them in
> my development resources folder. I don't want to include all of them in
> deployed databases so I have this method that loops all the forms and all
> the objects making a list of the ones I actually use and then creating a
> subset folder of just those icons for shipping. It's a PITA.
> 
> I am going to be changing that so I'll loop through all the form objects as
> now but if I refer to a file in my icons folder I'll put a copy of that
> icon in the library and change the ref in the object. This way I will be
> able to refer to the full icon set during development but not ship it.
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows script?

2018-10-08 Thread Jeremy Roussak via 4D_Tech
Thanks, Jim. That looks promising.

Jeremy


> On 8 Oct 2018, at 12:37, Jim Hays via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> wscript.exe is one way to go.
> 
> To learn how to write the particular script for MS Word on Windows, let it
> record a macro of what you want to do.
> You can pull the macro out into a text file and run it with wscript (with a
> few more commands to get Word started and point at the document).
> To record a Macro, you can type in "record a macro" in the "Tell me what
> you want to do" box.
> Or, go to the Views tab and find Macros on the right.
> 
> Google is your friend - running VBA macros.
> 
> HTH,
> 
> Jim
> 
> 
> 
> 
> 
> On Sun, Oct 7, 2018 at 6:02 PM Jeremy Roussak via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> I have an AppleScript which is called from 4D with four numeric
>> parameters. Provided MS Word is running and the cursor is in a table, it
>> fills columns 2 to 5 of the table with its parameters and tabs out of the
>> last column, probably creating a new row in the table.
>> 
>> I’m now called upon to make the 4D application, and hence the script, work
>> under Windows. Sadly, and a bit problematically I haven’t a clue about
>> scripting Windows. I imagine it can be done in VB. Any help would be most
>> gratefully received!
>> 
>> The AppleScript is below.
>> 
>> Thanks
>> 
>> Jeremy
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Notes on converting pictures to v17

2018-10-08 Thread Kirk Brooks via 4D_Tech
I'm preparing to move a large, established project from v15 to v17 and
finally had to deal with the pictures. I've been putting this off at least
partly because of just not wanting to deal with this. Turns out it's not
that big a deal, at least for me.

When I've just done the conversion to see what happened lots of old forms,
the ones 4D creates, had the dreaded red X in the button icons. Most of my
forms were fine because for a long time I've been using icons from the
resource folder which were already .png. But I still had to do something
about the legacy images.

1) converting the picture library
This was really easy. As numerous folks have pointed out this is where to
start:

http://kb.4d.com/assetid=76775

I don't have 4D Pack installed any more and didn't see an easy, native way
of determining what kind of file a picture library resource is. But then I
realized I really don't care what they were because I was going to make
them all .png now. So I modified the loop to simply convert all the images
to .png.

I did this in the v15 version.

2) the outliers
A number of forms have static images in them. This illustrated the various
strategies 4D has used over the years for building the default forms. I
didn't pay enough attention to determine which versions did what but some
forms have static images as backgrounds that are incompatible and some
don't.

I quickly noticed lots of them were named "Picture6". Doing a find in
design located all the forms with "Picture6" and opened each one deleting
the obsolete image. Sometimes the image was OK. None of these forms are
user-facing so they don't really matter but the point is it's easy to find
them and relatively quick to delete them.

Bottom line - this wasn't nearly as painful or time consuming a deal as I
feared.

Unexpected discovery - the picture library is still a useful thing!

I had equated the library with .pict files and stopped paying attention to
it. This isn't the case and the tools for managing what's in the library
are simple to use. You can't edit images directly anymore (that's way gone)
but storing .png files is a snap and for me a lot easier than managing them
from Resources.

It's also easier if you have a large collection of icons but only use a
few. I have a set of icons I like and use but there are hundreds of them in
my development resources folder. I don't want to include all of them in
deployed databases so I have this method that loops all the forms and all
the objects making a list of the ones I actually use and then creating a
subset folder of just those icons for shipping. It's a PITA.

I am going to be changing that so I'll loop through all the form objects as
now but if I refer to a file in my icons folder I'll put a copy of that
icon in the library and change the ref in the object. This way I will be
able to refer to the full icon set during development but not ship it.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows script?

2018-10-08 Thread Jim Hays via 4D_Tech
wscript.exe is one way to go.

To learn how to write the particular script for MS Word on Windows, let it
record a macro of what you want to do.
You can pull the macro out into a text file and run it with wscript (with a
few more commands to get Word started and point at the document).
To record a Macro, you can type in "record a macro" in the "Tell me what
you want to do" box.
Or, go to the Views tab and find Macros on the right.

Google is your friend - running VBA macros.

HTH,

Jim





On Sun, Oct 7, 2018 at 6:02 PM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have an AppleScript which is called from 4D with four numeric
> parameters. Provided MS Word is running and the cursor is in a table, it
> fills columns 2 to 5 of the table with its parameters and tabs out of the
> last column, probably creating a new row in the table.
>
> I’m now called upon to make the 4D application, and hence the script, work
> under Windows. Sadly, and a bit problematically I haven’t a clue about
> scripting Windows. I imagine it can be done in VB. Any help would be most
> gratefully received!
>
> The AppleScript is below.
>
> Thanks
>
> Jeremy
>
> -- paste the arguments into the last four columns of the current table
> -- then tab into the first column, probably creating a new row
> -- called from the periodic multipliers tab
>
> on run argv
>
> if (WordIsRunning()) then
>
> tell application "Microsoft Word"
>
> activate
>
> if (get selection information selection
> information type with in table) is "true" then
>
> set tTable to selection's table 1
> set rowNum to row index of (selection's
> row 1)
> set colNum to (count tTable's columns) - 4
>
> repeat with i from 1 to 4
> set tCell to text object of (get
> cell from table tTable row rowNum column (colNum + i))
> set tPara to tCell's paragraph 1
> set tPara's text object's content
> to (item i of argv)
> end repeat
>
> set curCol to column index of (selection's
> column 1)
>
> repeat (colNum - curCol + 5) times
> tell application "System Events"
> keystroke "\t"
> end tell
> end repeat
>
> end if
>
> end tell
>
> end if
>
> end run
>
> on WordIsRunning()
> tell application "System Events"
> return (bundle identifier of processes) contains
> "com.microsoft.Word"
> end tell
> end WordIsRunning
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**