This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSquareify.scpl
90 lines (83 loc) · 2.26 KB
/
Squareify.scpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@import "../lib/fallback.scpl"
@set debug false
@set mock false
@import "../lib/helpers.scpl"
@Icon boxoutline
@Color pink
@ShowInWidget true
@ShowInShareSheet true
@Accepts "Images,Media"
ShowResult "The process will now continue in-app."
ContinueShortcutinApp
SetVariable v:argv
Comment
|Description:
|Overlay an image onto a square background.
|
|Expects an image input from the share sheet. If no image is passed, the photo picker will be prompted.
Dictionary {
"shortcut" : "Squareify",
"author" : "@supermamon",
"version" : "2.3",
"settings" : {
"updater" : {
"RoutineHubID": 95
}
},
"changed" : {
"v1.0.0": "Initial release",
"v1.1.0": "Add options for saving & viewing",
"v1.1.1": "Fixed crash during resize process",
"v2.0.0": [
"Allow picking photo when not using share sheet",
"Add UpdateKit/RoutinHub support"
],
"v2.1.0": "Use shortcut metadata for UpdateKit",
"v2.2" : "Switch to major.minor versioning",
"v2.3" : "Embedded update checker",
},
"options" : "-----------------",
"bgcolor" : "black"
} -> mv:meta
GetVariable mv:meta:settings -> v:opt
GetVariable mv:meta:shortcut -> v:self
GetVariable v:argv
Count Items
If Equals 0
SelectPhotos
SetVariable v:argv
End
GetVariable v:argv
GetDetailsofImages Width -> mv:width
SetVariable v:max
GetVariable v:argv
GetDetailsofImages Height -> mv:height
If "Is Greater Than" number=v:max
SetVariable v:max
End -> mv:If
Text
|<style>* {
| background-color:\(mv:meta.bgcolor)
|}
|</style><body></body>
MakeRichTextfromHTML
MakePDF
ConvertImage format="PNG" preserveMetadata=false
ResizeImage width=v:max height=v:max -> mv:"Resize Image"
OverlayImage image=v:argv showImageEditor=false width=mv:width height=mv:height -> mv:"Overlay Image"
ChoosefromMenu prompt="" items=["Save & Show", "Show Only"]
Case
SavetoPhotoAlbum -> mv:"Save to Photo Album"
QuickLook
Case
QuickLook
End -> mv:"Choose from Menu"
Nothing
Comment "..:: checkForUpdate Args ::.."
Dictionary {
name : v:self,
id : v:opt:"updater.RoutineHubID",
version : mv:meta:version,
noUpdAlert : "hide"
} -> v:argv
@import "../lib/checkForUpdate-inline.scpl"