{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "phone-to-mac",
        "name": "Phone to Mac",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564606,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "169a7615c5762a134e0ee84e284bfbf1b290e658d84e980ae3e81f9d85d310e4"
        },
        "signature": "rV+kaCaeXDlGhQwCqk+JdgMBQxc/f82T2J0vRKwpVuVpeghGmcqI8y9simkyShAXlMjkMTnFFCJhxTAF5w2hCQ==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "phone-to-mac",
        "name": "Phone to Mac",
        "description": "Send a photo or a file from your iPhone to your Mac: it lands in a folder you choose and shows in the card.",
        "icon": "iphone.and.arrow.forward",
        "permissions": [
            "camera",
            "inbox:files",
            "send:files",
            "files.write:dest",
            "clipboard.write"
        ],
        "settings": {
            "dest": {
                "type": "folder",
                "label": "Save files to",
                "default": "~/Downloads/From iPhone",
                "create": true,
                "required": true,
                "platforms": [
                    "macos"
                ]
            }
        },
        "sources": {
            "incoming": {
                "inbox": "files",
                "on_receive": "got_file"
            }
        },
        "state": {
            "files": {
                "type": "list",
                "default": []
            },
            "photos": {
                "type": "list",
                "default": []
            },
            "sent": {
                "type": "list",
                "default": []
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "gallery": "$photos",
                            "limit": 6,
                            "height": "m",
                            "thumb": "$item.thumb",
                            "on_select": "copy_photo",
                            "when": "$photos"
                        },
                        {
                            "text": "Click a photo to copy it.",
                            "size": "s",
                            "emphasis": "subtle",
                            "when": "$photos"
                        },
                        {
                            "list": "$files",
                            "limit": 5,
                            "item": {
                                "row": [
                                    {
                                        "text": "$item.name",
                                        "grow": true,
                                        "lines": 1
                                    },
                                    {
                                        "text": "$item.at | ago",
                                        "size": "s",
                                        "emphasis": "subtle"
                                    }
                                ]
                            },
                            "when": "$files"
                        },
                        {
                            "text": "Photos and files you send from TailApps on your iPhone land here and in your Save files to folder. Turn on Sync to My Devices for this card on both.",
                            "size": "s",
                            "emphasis": "subtle",
                            "when": "$files | count | map:{0:true, else:false}"
                        }
                    ],
                    "gap": "m"
                }
            },
            {
                "id": "phone",
                "layout": {
                    "column": [
                        {
                            "button": "Take Photo",
                            "on": "snap",
                            "style": "primary",
                            "size": "l",
                            "grow": true,
                            "icon": "camera",
                            "disabled": "$running.snap"
                        },
                        {
                            "button": "Choose Photo",
                            "on": "choose_photo",
                            "style": "secondary",
                            "size": "l",
                            "grow": true,
                            "icon": "photo.on.rectangle",
                            "disabled": "$running.choose_photo"
                        },
                        {
                            "button": "Choose File",
                            "on": "choose_file",
                            "style": "secondary",
                            "size": "l",
                            "grow": true,
                            "icon": "doc",
                            "disabled": "$running.choose_file"
                        },
                        {
                            "list": "$sent",
                            "limit": 5,
                            "item": {
                                "row": [
                                    {
                                        "text": "$item.name",
                                        "grow": true,
                                        "lines": 1
                                    },
                                    {
                                        "text": "$item.delivered | map:{0:'Not delivered', else:'Sent'}",
                                        "size": "s",
                                        "tone": "$item.delivered | tone:{warn:'<1', else:'good'}"
                                    }
                                ]
                            },
                            "when": "$sent"
                        },
                        {
                            "text": "Not delivered means no Mac has this card with Sync to My Devices on.",
                            "size": "s",
                            "emphasis": "subtle",
                            "when": "$sent"
                        },
                        {
                            "text": "Each photo or file goes to this card on your Mac, up to 10 MB. Turn on Sync to My Devices for it here and on the Mac.",
                            "size": "s",
                            "emphasis": "subtle",
                            "when": "$sent | count | map:{0:true, else:false}"
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "actions": {
            "snap": {
                "runs_on": [
                    "ios"
                ],
                "steps": [
                    {
                        "camera.take": [],
                        "as": "p"
                    },
                    {
                        "send": {
                            "files": {
                                "name": "$p.name",
                                "kind": "$p.kind",
                                "at": "$now"
                            }
                        },
                        "file": "$p.path",
                        "as": "out"
                    },
                    {
                        "push": {
                            "sent": {
                                "name": "$p.name",
                                "delivered": "$out.delivered",
                                "at": "$now"
                            }
                        },
                        "max": 20
                    }
                ]
            },
            "choose_photo": {
                "runs_on": [
                    "ios"
                ],
                "steps": [
                    {
                        "photos.pick": [],
                        "as": "p"
                    },
                    {
                        "send": {
                            "files": {
                                "name": "$p.name",
                                "kind": "$p.kind",
                                "at": "$now"
                            }
                        },
                        "file": "$p.path",
                        "as": "out"
                    },
                    {
                        "push": {
                            "sent": {
                                "name": "$p.name",
                                "delivered": "$out.delivered",
                                "at": "$now"
                            }
                        },
                        "max": 20
                    }
                ]
            },
            "choose_file": {
                "runs_on": [
                    "ios"
                ],
                "steps": [
                    {
                        "files.pick": {
                            "max_mb": 10
                        },
                        "as": "p"
                    },
                    {
                        "send": {
                            "files": {
                                "name": "$p.name",
                                "kind": "$p.kind",
                                "at": "$now"
                            }
                        },
                        "file": "$p.path",
                        "as": "out"
                    },
                    {
                        "push": {
                            "sent": {
                                "name": "$p.name",
                                "delivered": "$out.delivered",
                                "at": "$now"
                            }
                        },
                        "max": 20
                    }
                ]
            },
            "got_file": {
                "steps": [
                    {
                        "if": "$args.file",
                        "then": [
                            {
                                "files.save": {
                                    "data": "$args.file",
                                    "to": "$settings.dest",
                                    "name": "$args.event.name"
                                },
                                "as": "saved"
                            },
                            {
                                "push": {
                                    "files": {
                                        "name": "$args.event.name",
                                        "path": "$saved",
                                        "from": "$args.from",
                                        "at": "$args.event.at"
                                    }
                                },
                                "max": 30
                            },
                            {
                                "if": "$args.event.kind | map:{image:true, else:false}",
                                "then": [
                                    {
                                        "push": {
                                            "photos": {
                                                "thumb": "$saved",
                                                "name": "$args.event.name"
                                            }
                                        },
                                        "max": 12
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "copy_photo": {
                "steps": [
                    {
                        "clipboard.write": {
                            "image": "$args.item.thumb"
                        }
                    }
                ]
            }
        },
        "views": {
            "menubar": {
                "icon": "iphone.and.arrow.forward",
                "label": "{$files | count} from iPhone",
                "card": "main"
            },
            "phone": {
                "card": "phone"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"phone-to-mac\",\n  \"name\": \"Phone to Mac\",\n  \"description\": \"Send a photo or a file from your iPhone to your Mac: it lands in a folder you choose and shows in the card.\",\n  \"icon\": \"iphone.and.arrow.forward\",\n  \"permissions\": [\n    \"camera\",\n    \"inbox:files\",\n    \"send:files\",\n    \"files.write:dest\",\n    \"clipboard.write\"\n  ],\n  \"settings\": {\n    \"dest\": {\n      \"type\": \"folder\",\n      \"label\": \"Save files to\",\n      \"default\": \"~/Downloads/From iPhone\",\n      \"create\": true,\n      \"required\": true,\n      \"platforms\": [\n        \"macos\"\n      ]\n    }\n  },\n  \"sources\": {\n    \"incoming\": {\n      \"inbox\": \"files\",\n      \"on_receive\": \"got_file\"\n    }\n  },\n  \"state\": {\n    \"files\": {\n      \"type\": \"list\",\n      \"default\": []\n    },\n    \"photos\": {\n      \"type\": \"list\",\n      \"default\": []\n    },\n    \"sent\": {\n      \"type\": \"list\",\n      \"default\": []\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"gallery\": \"$photos\",\n            \"limit\": 6,\n            \"height\": \"m\",\n            \"thumb\": \"$item.thumb\",\n            \"on_select\": \"copy_photo\",\n            \"when\": \"$photos\"\n          },\n          {\n            \"text\": \"Click a photo to copy it.\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$photos\"\n          },\n          {\n            \"list\": \"$files\",\n            \"limit\": 5,\n            \"item\": {\n              \"row\": [\n                {\n                  \"text\": \"$item.name\",\n                  \"grow\": true,\n                  \"lines\": 1\n                },\n                {\n                  \"text\": \"$item.at | ago\",\n                  \"size\": \"s\",\n                  \"emphasis\": \"subtle\"\n                }\n              ]\n            },\n            \"when\": \"$files\"\n          },\n          {\n            \"text\": \"Photos and files you send from TailApps on your iPhone land here and in your Save files to folder. Turn on Sync to My Devices for this card on both.\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$files | count | map:{0:true, else:false}\"\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    },\n    {\n      \"id\": \"phone\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"button\": \"Take Photo\",\n            \"on\": \"snap\",\n            \"style\": \"primary\",\n            \"size\": \"l\",\n            \"grow\": true,\n            \"icon\": \"camera\",\n            \"disabled\": \"$running.snap\"\n          },\n          {\n            \"button\": \"Choose Photo\",\n            \"on\": \"choose_photo\",\n            \"style\": \"secondary\",\n            \"size\": \"l\",\n            \"grow\": true,\n            \"icon\": \"photo.on.rectangle\",\n            \"disabled\": \"$running.choose_photo\"\n          },\n          {\n            \"button\": \"Choose File\",\n            \"on\": \"choose_file\",\n            \"style\": \"secondary\",\n            \"size\": \"l\",\n            \"grow\": true,\n            \"icon\": \"doc\",\n            \"disabled\": \"$running.choose_file\"\n          },\n          {\n            \"list\": \"$sent\",\n            \"limit\": 5,\n            \"item\": {\n              \"row\": [\n                {\n                  \"text\": \"$item.name\",\n                  \"grow\": true,\n                  \"lines\": 1\n                },\n                {\n                  \"text\": \"$item.delivered | map:{0:'Not delivered', else:'Sent'}\",\n                  \"size\": \"s\",\n                  \"tone\": \"$item.delivered | tone:{warn:'<1', else:'good'}\"\n                }\n              ]\n            },\n            \"when\": \"$sent\"\n          },\n          {\n            \"text\": \"Not delivered means no Mac has this card with Sync to My Devices on.\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$sent\"\n          },\n          {\n            \"text\": \"Each photo or file goes to this card on your Mac, up to 10 MB. Turn on Sync to My Devices for it here and on the Mac.\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$sent | count | map:{0:true, else:false}\"\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"actions\": {\n    \"snap\": {\n      \"runs_on\": [\n        \"ios\"\n      ],\n      \"steps\": [\n        {\n          \"camera.take\": {},\n          \"as\": \"p\"\n        },\n        {\n          \"send\": {\n            \"files\": {\n              \"name\": \"$p.name\",\n              \"kind\": \"$p.kind\",\n              \"at\": \"$now\"\n            }\n          },\n          \"file\": \"$p.path\",\n          \"as\": \"out\"\n        },\n        {\n          \"push\": {\n            \"sent\": {\n              \"name\": \"$p.name\",\n              \"delivered\": \"$out.delivered\",\n              \"at\": \"$now\"\n            }\n          },\n          \"max\": 20\n        }\n      ]\n    },\n    \"choose_photo\": {\n      \"runs_on\": [\n        \"ios\"\n      ],\n      \"steps\": [\n        {\n          \"photos.pick\": {},\n          \"as\": \"p\"\n        },\n        {\n          \"send\": {\n            \"files\": {\n              \"name\": \"$p.name\",\n              \"kind\": \"$p.kind\",\n              \"at\": \"$now\"\n            }\n          },\n          \"file\": \"$p.path\",\n          \"as\": \"out\"\n        },\n        {\n          \"push\": {\n            \"sent\": {\n              \"name\": \"$p.name\",\n              \"delivered\": \"$out.delivered\",\n              \"at\": \"$now\"\n            }\n          },\n          \"max\": 20\n        }\n      ]\n    },\n    \"choose_file\": {\n      \"runs_on\": [\n        \"ios\"\n      ],\n      \"steps\": [\n        {\n          \"files.pick\": {\n            \"max_mb\": 10\n          },\n          \"as\": \"p\"\n        },\n        {\n          \"send\": {\n            \"files\": {\n              \"name\": \"$p.name\",\n              \"kind\": \"$p.kind\",\n              \"at\": \"$now\"\n            }\n          },\n          \"file\": \"$p.path\",\n          \"as\": \"out\"\n        },\n        {\n          \"push\": {\n            \"sent\": {\n              \"name\": \"$p.name\",\n              \"delivered\": \"$out.delivered\",\n              \"at\": \"$now\"\n            }\n          },\n          \"max\": 20\n        }\n      ]\n    },\n    \"got_file\": {\n      \"steps\": [\n        {\n          \"if\": \"$args.file\",\n          \"then\": [\n            {\n              \"files.save\": {\n                \"data\": \"$args.file\",\n                \"to\": \"$settings.dest\",\n                \"name\": \"$args.event.name\"\n              },\n              \"as\": \"saved\"\n            },\n            {\n              \"push\": {\n                \"files\": {\n                  \"name\": \"$args.event.name\",\n                  \"path\": \"$saved\",\n                  \"from\": \"$args.from\",\n                  \"at\": \"$args.event.at\"\n                }\n              },\n              \"max\": 30\n            },\n            {\n              \"if\": \"$args.event.kind | map:{image:true, else:false}\",\n              \"then\": [\n                {\n                  \"push\": {\n                    \"photos\": {\n                      \"thumb\": \"$saved\",\n                      \"name\": \"$args.event.name\"\n                    }\n                  },\n                  \"max\": 12\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    },\n    \"copy_photo\": {\n      \"steps\": [\n        {\n          \"clipboard.write\": {\n            \"image\": \"$args.item.thumb\"\n          }\n        }\n      ]\n    }\n  },\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"iphone.and.arrow.forward\",\n      \"label\": \"{$files | count} from iPhone\",\n      \"card\": \"main\"\n    },\n    \"phone\": {\n      \"card\": \"phone\"\n    }\n  }\n}\n",
    "files": []
}