Alpha Video Training
Results 1 to 7 of 7

Thread: Script to add jpg to table jpg field

  1. #1
    Member
    Real Name
    Bob M
    Join Date
    Dec 2001
    Posts
    567

    Default Script to add jpg to table jpg field

    Is there a way to Action Script the addition of a jpg to a field in a database?

    I have the image naming part resolved using an auto increment picture number. I can prompt for a filename and get to the folder where the jpg is located on my computer.

    I can't find an action script method to get the actual jpg stored in the table field so it can appear on a form when that picture number is highlighted in the appropriate browser.


    Thanks

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,405

    Default Re: Script to add jpg to table jpg field

    Do you need it stored or just displayed?
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    Member
    Real Name
    Bob M
    Join Date
    Dec 2001
    Posts
    567

    Default Re: Script to add jpg to table jpg field

    Ted,

    Display is fine although embedded would be more ideal.

    Right now, to add an image of a grandkid, I auto number the image then use the select image icon associated with the jpg field. Apparently (meaning I can't find a setting to the contrary), the icon will only show jpeg files. And naturally, all the images I have gathered over several years are jpg, so I have to click the file type in the select box to switch to display jpg files. I can get the Alpha open file prompt to work with a script but I can't get beyond that to bring the image into the field when I select a specific image.

    It really isn't tough to use the icon, which works for my need. But doing it a 1,000 or so times is getting old when I know it can somehow be done with clicking a button, clicking an image and done.

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,405

    Default Re: Script to add jpg to table jpg field

    It's doable Mortie.
    I have had to automatically pick photos from a folder which match a name in the table.
    That was 200 years ago. Let me see if I still have the code.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,405

    Default Re: Script to add jpg to table jpg field

    Field Rules

    Image Field - the field where the image will reside
    . Data Entry
    ...Simple default expression
    .....Default value - I set this to a Variable, you can probably set it to summat like
    [c:\Images\Undefined.jpg] Create an Image which is named Undefined.jpg and put it in your Images Folder. Now when you click on the image add icon, only the .jpg images should show.
    The logic is that undeclared items show jpeg, but specific ones show the current or last used extension.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  6. #6
    Member
    Real Name
    Bob M
    Join Date
    Dec 2001
    Posts
    567

    Default Re: Script to add jpg to table jpg field

    Giving it a go Ted.

    Is there a way to do this method when there are 4 folders with images? (four grandkids!)

  7. #7
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,405

    Default Re: Script to add jpg to table jpg field

    Yes, Bob. I can think of a number of ways which might suit you.
    Some are easier, the others slightly more complicated - but not much more.

    Way 1)
    Combine the folders of the images, but start naming the actual image in a logical fashion.
    As in;
    Billy_Image1
    Mandy_Image1
    Suzie_Image1
    Harry_Image1
    Billy_Image2 - 99

    In this case the use of an ALIAS field in your application will help identify the actual images, as in;
    Alias Field "Billy at the summer camp"
    Image Field = 2019Billy_Image1

    Way 2)
    Leave the folders separate for each set of images.
    Have 4 Tables - I am assuming you have 4 folders of images you want to import.
    Have a separate Form attached to each Table.
    When the Form is launched, create a Variable - Form/Events/OnInit - which relates to the Folder you have the images you want in it.
    Like D:\Users\Ted\Pictures\Web Art\No_Image.jpg - where No_Image.jpg will trigger the search on jpgs.
    Use this Variable as the Default setting in the Image Field, Field Rules in the Table as I mentioned in the previous post.
    Then, you can create a Set with all the tables showing however you want - if you want them all in one place.

    Way 3)
    Leave the folders as separate sets of Images.
    Create a Drop Down process with the 4 Folder locations in it and construct a Variable using that.
    This variable will be used in the Field Rules as above.
    Then, the images can be from different folders on the one Form - if you select the correct drop down that is.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Combo Script to Capture a 2nd field from Another Table
    By Garth Groft in forum Alpha Five Version 11 - Desktop Applications
    Replies: 21
    Last Post: 04-19-2015, 06:38 PM
  2. Need Help with Script Which Updates Field in Table Based on Matching Parent Table Record
    By Garth Groft in forum Alpha Five Version 11 - Desktop Applications
    Replies: 29
    Last Post: 04-04-2015, 08:56 PM
  3. Replies: 2
    Last Post: 11-25-2013, 07:17 PM
  4. Script works with memo field fails with character field
    By werder101010 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 12-02-2009, 09:24 AM
  5. Table Not Found Script
    By forskare in forum Alpha Five Version 5
    Replies: 6
    Last Post: 02-16-2004, 10:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •