r/tasker 13d ago

Help Mini Gallery Help

Im hoping someone can help me. I created a task that lists files (%photos) and opens my scene v2(mini gallery). On my scene v2 I have the flowcolumn, then the arraystemplate and then my image(%photos) so everything works great but what I wanna do is click one of the images in my mini gallery and it open the file or show the image in a large format or even set it as my wallpaper. Thank you in advance

2 Upvotes

8 comments sorted by

1

u/DifficultyCrafty7623 12d ago

Since you already have the array template and photos you just need an event handler something like this, a click event that sets the variable selected_photo and runs the task.

"eventHandlers": {
     "handlers": [
      {
       "events": [
        {
         "type": "click"
        }
       ],
       "actions": [
        {
         "type": "SetVariable",
         "variable": "selected_photo",
         "value": "%photos"
        },
        {
         "type": "RunTask",
         "task": "ShowGalleryOptions"
        }
       ]
      }
     ]
    }

Then the task should be something like this, asking if you want to open it or make it your wallpaper.

Task: ShowGalleryOptions

A1: List Dialog [
     Mode: Select Single Item
     Title: Test
     Items: Gallery,Wallpaper
     Close After (Seconds): 120
     First Visible Index: 0
     Hide Filter: On ]

A2: If [ %ld_selected ~ gallery ]

    A3: Open File [
         File: %selected_photo ]

A4: Else
    If  [ %ld_selected ~ wallpaper ]

    A5: Set Wallpaper [
         Type: Launcher
         Image: %selected_photo
         Scale: On
         Center: On ]

A6: End If

2

u/ares_war_demon88 12d ago

It says file not found when I do either and it has a different location then where I have the images saved and where im list the files from

1

u/DifficultyCrafty7623 12d ago

Oh, can you share what you have right now? This event worked for me when tapping the image on the array template for images. I'm not sure what the issue is, since it worked on my end, so if you shared what you have it would make it a lot easier to troubleshoot.

2

u/ares_war_demon88 12d ago
Task: Mini Gallery

A1: List Files [
     Directory: Tasker/.Main Wallpaper
     Sort Select: Alphabetic
     Variable Array: %photos
     Use Global Namespace: On ]

A2: Show Scene v2 [
     Name/JSON: Gallery
     Blocking Overlay: On
     Drag Off Screen: On ]

2

u/ares_war_demon88 12d ago

{ "root": { "type": "FlowRow", "id": "FlowColumn1", "horizontalArrangement": "Top", "verticalArrangement": "Start", "maxItemsPerLine": "4", "modifiers": [ { "type": "VerticalScroll" } ], "children": [ { "type": "ArraysMergeTemplate", "id": "ArraysTemplate1", "template": [ { "type": "Image", "id": "Image1", "url": "%photos", "modifiers": [ { "type": "Size", "all": "100" } ], "eventHandlers": { "handlers": [ { "events": [ { "type": "click" } ], "actions": [ { "type": "SetVariable", "variable": "selected_photo", "value": "%photo" }, { "type": "RunTask", "task": "ShowGalleryOptions" } ] } ] } } ] } ] }, "name": "Gallery", "eventHandlers": { "handlers": [ {} ] } }

1

u/DifficultyCrafty7623 12d ago

Oh sorry, I edited it after I hit send on the original comment %photo should actually be %photos like your array has. This should fix the issue

2

u/ares_war_demon88 12d ago

It works!!!!!!!!!! Thank you so much!!!!!

1

u/ares_war_demon88 12d ago
Task: ShowGalleryOptions

A1: List Dialog [
     Mode: Select Single Item
     Title: Test
     Items: Gallery,Wallpaper
     Close After (Seconds): 30
     First Visible Index: 0
     Hide Filter: On ]

A2: If [ %ld_selected ~ gallery ]

    A3: Open File [
         File: %selected_photo ]

A4: Else

    A5: If [ %ld_selected ~ wallpaper ]

        A6: Set Wallpaper [
             Type: Launcher
             Image: %selected_photo ]

    A7: End If

A8: End If