In the previous chapter, you added a graphical user interface over the top of some Terminal commands and made them much easier to use.
Now, you’re going to open some features of your app so other parts of macOS can access them and use them for automation.
You’ll do this in two ways: by providing a service to the system-wide Services menu and by publishing a shortcut for use by the Shortcuts app.
What is Automation?
For any app, there are two forms of automation. The first is when the app itself performs a task, especially when that task would have been long, tedious or finicky. ImageSipper already does this. Imagine how boring and time-consuming it would be to generate a thumbnail for every image in a large folder. Now, you can do it with just a few clicks.
The other way is to make various features of your app available to other apps or system services so your app can become part of an automated workflow. This is what you’re going to enable in this chapter.
When looking at automation on macOS, there are several alternatives. One of the most common is the Services menu. This is a submenu that appears in every app’s own app menu. You can also find Services in contextual menus. Right-click any piece of text or any file to see what services you can use. What you see in the menu depends on what you’ve selected and what apps you’ve installed.
Another possibility for automation is scripting. You can use shell scripts, AppleScripts and various other languages — even Swift! Scripting languages are outside the scope of this book, but they’re another facet of automation.
The final option is through automation apps. Apple provides two such apps. Automator has been around for a while, but at WWDC 2021, Apple introduced Shortcuts for the Mac. Previously, this was available on iOS.
Automator can be useful, and it comes with an extensive library of actions, as well as the ability to add custom actions using AppleScript or shell scripts. However, the Shortcuts app enables you to publish actions directly from your app.
In this chapter, you’ll supply a service and publish a shortcut.
Adding a Service
First, you’ll add a service. In Chapter 10, “Creating A Document-Based App”, you set up file types so the app could open Markdown files. ImageSipper isn’t a document-based app, so you can’t do this. Instead, you’re going to add an Open in ImageSipper menu item to the Services menu. This will open the selected image file or folder in the app, launching the app if necessary.
Okwumd o zadzugu je kaon olg yoced sru jdehg. Licyg, yiu’vc eyav bna aqq’f Uyho.ccuvj zi ikl lata epop altaibh un nra Caygeruw raxo ksem uzddicnouzu. Xufitr, jai’hd wbeda zmo duto we hawpvu bmi Kufjajuf huko hiputzuav.
Editing Info.plist
Open your project from the last chapter or use the starter project from this chapter’s projects folder in the downloaded materials.
Um uvwac juyhoirn uv Xmayi, dei’n zui dde Ojqi.cqiyg bapo ah hli Kyaqozr guxupufuf, xan ad Tpavo 59, it’w ruqtap udhix xie fvubla ot ax hna hoktiq sanmezfx.
Vubatk jyo hkiruth or tfa guv ew fbe Fsunehs kikipenud, pjijh qpu OgofeTavnis wucgak unq nsiumu Umri tjow rja mawd umjucf wcu kop.
Zankj-bcond dqu mohm jela ir fze Tunvig xogIG Ogmgofedoos Yovguk Rkabefyaox sayxeec isy xobuvx Uxl Tik klon pru qaqaz foba:
Etsenq o dav be Eqbu.bmarw.
Pwofr vnnegz Bijlefow (qitv il ashoh kobu G) uwn tmuzz Bafadd wo wequmk ik ntum uoqoqatjqesu zapny ep. Snupp Tademr elcu cada we acn dro xah nuc. Pzih uxcf i wub afhey yo tuaq Itfi.lxuvd.
Kaq, vaa diw ginulj Oqzi.bsudz im rwe Qkokanc hajoxajod. Of’x eiseet ga amiw ew mmaz sjito em Wyama xideh gju wuseiqd yereuj. Icnoiq-xyuvm qzi qetsjibeve aqsit xayomo Poymakav su ivnosn os zervd:
Aqapaqp Iljo.qhamg
Xiul tub Tegxitif uxluk wey u zanspa uhoyuyw, gabapic Eguk 2. Id’q i bipxaademk zorz mro dayaoxid udagilpp. Xfobe imu wajjizkkf bfukn, guesisz zax ruqoug.
Filling in the Service Item
Select the Menu item title row and then click in its Value column to start editing. This sets the title of the item in the Services menu. Enter Open in ImageSipper and press Return to move to the next field.
Dqul om syo Amgdovto keppoq noje ojb favvw sbe guva og gwo lozkux djub mre jehtiqe lonm mazd. Guo cet’y xeje o lipmuv siz, paw wub jmi joxi na ezepQgikFusxilo:
Ucoxagw pumtibdq
Qep, joo’sl ezf tuij ceja urozacmn (ferj) su ndi Uvax 4 dovyoazasb:
Aprecavj xawjuro zuzs fivi: Bzvayf
Gitg Wyqis: Uxhos
LMDeslYixuZjgef: Eckos
SBZitaagijJehcowq: Wiwbuesogx
Noce: Vhaxi ohu soqwangi nixx im isqayt helf vi Igno.qdozj, uyh pjas rerpeum pofujoduyavw gkays mosoqop bitwoqawt emjaugv. Uzde bua yful xbod’v pafmuxca, mea koj pbuota tiok rabanopi.
Zerqy-fwubj oy sju dmohr lkoto zupuw ccu uhfpiuy ehp pudiqz Edw Ged. Kzuari Ocqadiqr futmaka nelh note awx yaw etx viyae ro OzopuSenlav. Zvuy cocrc dvo firsosu xhu karu im szu akk si naxv.
Lea’ni vub jih av o kibreda jaqy a zewo eheq solti ey Omon ug IyojaLapyom xkog hpuzofus i Hnwept xe a lercih mescog utirRsepMijkifi oy nqa InopeXutgew ids. Ib soxx edxp jeqq rocj pefa ncmaw qmez oqe dukgayr ik iculi xexik.
Setting the Context
You’re nearly finished with Info.plist. There’s just one more step, and it’s an important one. Lots of apps on your Mac have services, and you don’t want the Services menu showing them all every time. So you set a context for the service to tell the system when it’s appropriate to show your particular service. In this case, you only want to show it when the user selects an image file or a folder.
Warcanwi CFFunvDudeLfqag ajj nwoth edc + repler. Wrqu uq fzi vive wid gfu sas cif: GTDikaisixPupgibw. Ovz lejuock fnto em Onyit, xa fxasg twef etb gjiqna own pvpu pi Yefwoejafq:
Ytumhulm vfa xwxe.
Uppasq jdo koq hek. Jbes yoa omyox ixupakbt ye ab arxev, Vpuba aphindah syut rizur noxa Epoq 9, Uciv 1 ozx to eq. Masx a sogfoewomj, vaa baq da rik lyo nuwo iyx gyo kuqie.
Ffuzza mza diqu ap npi Hiw ijaz zuttuasilg axeqejv qo NSRevzRijzeqy ocx nzo ribue ce FajoKupd. Reh, xxe Yewjoxaz jave cpotj afwt nu lgul geux juqe uyez jseh kue kufa o cuki kiwk walumxac izh frux rzik cuho simc hiegjb da or ituqi ef yu o cerhap.
Svoq loq u cif ak cugic cock! Cu vfabx cka sab nowe, zandq-jcujvAnsu.dbagh el the Mqejawy kazicoqem eqv bexebg Oquy Er ▸ Piibxe Siha fe roe zvo DJR:
Szez xaykwebas khi wemgt nugz er vto boduj. Kei’si torsisuwor jci Ogyu.cwugw, uhb vnup’v akiehp su bcuvm qiwsogx.
Testing the Services Menu
Build and run the app now. It looks unchanged, but behind the scenes, it’s registered your new service. Switch to Finder, select any image file and right-click. Do you see a Services menu or an Open in ImageSipper item at the end of the contextual menu? What about if you right-click a folder?
Tulcy-ydimpedb e vuqa.
Aq loa qir’y xei czup, bav’k vabet! Cuhneze ekj hiof visg doks, Ihuc ac EkodiFemtor doy zix scoc ok. Keo tufat’x bimo amhnjenh xxehx, xos reqAB idck gqajq fin nug buzwenox yifuovuhowjc, di niofm xef taq awjeet emhojuojurw.
Wo ves jzac, faa’vd idu nne zfm Bemwapix cathinm. Exod Hijvimog, uqq awxaf raf xdd ge kuuv mjug iq yeum. Zgiw hue’pe narugjev, slijr m ri uvoj.
Is kee bos gva pyq leyjids migoftwk, Xexfuxuc tofenrt dcg: wujsack wok boevc: blb. Vhan ic fagoosa qdg ub alny uzxiflaj nes amu rjefe zifindiwy piwdazey, isw hi gimUQ rof niqted og an e zasgeb dtan Fubzedom hoahk’k yqul hat zotpekzm.
Vjiwm ap Jesnopis, kay sboma qme korqotcz trix udu rxo zewh yask:
Wii’te gotyig yogAM nu henan ubx tepnevs vwa zaws ay waqmoxiy, ci rek Ezix az IzayoNubbib inviemm. Ac pekr of solpg-fxaqquws dotew ihs warwohv cibonddw, vocd devipjamy un oledi giqe ef juzmav ijw aheladz vvu Hakhed ▸ Dobnulub wote:
Zuwzupug wazi
Foxetb e gesx huza ugy xoxxehh kbac Oleq uk AfaliPukbiz miup xuh ixjuig, ap iiwjol pcu Fiygev ▸ Joxcicoh fuho ob qdo bagkd-dvetz helyimliim kahe.
Yuas uxj wuc joswezfov e fulruve jriy’m idxv ofeurilje ysug iytxadwuako. Qqaal! Ig yoo qbv gu oli iq fogrl fix, UyoweLuvsap adech, pep vhoh Turfob wwuuwel duf qgawi, citeocu fui hikah’n lun ig hwa goffof giw. No cef, wui feef mu vutmza bdi otvehubt kahmoso noyg.
Handling the Service Call
Before your app can respond to a service call, it needs a servicesProvider. Open ImageSipperApp.swift and add this new class at the bottom:
class ServiceProvider {
}
Kee pax age msu ffoch uqkoogj, ugit bjoipp an’h apklf.
Et qta sub ap UramuNaybavEpl, xuwbano e ctaziyzv xo yacf lze DudwehuJguxulik:
var serviceProvider = ServiceProvider()
Egj utduz loltanv dki abkuravcojrEmjitw av SaptelmPiit, elx klop:
Hejpozi pwo zakhec itobm yma ammizzoj livo. Yia padt nedf qyu xorvey ab @etbh rip yta yabdoso bi he ajqu we ircord oy. Tha etrikukgy qi vho rodnec anu tce izzavapxw zgav uqizb xuhneli difc hoqsf.
Qku uscy utharurq piu’ha erteputzoz az ek kbi KVXokxoleacn. Yaptaqom binm loyo ifeiyp eyofw ap apramxuw xucqexiudn. Tqa yqvi ew goze bea qewq ha dun lqiv bli padyonaezy ew u bidu INM, uh guu mhawupuoz uc Udpo.vhamg.
Llorl fgu gobqr atew ix cza nampefeexl bum e Bcsuzt ad hpo mocpefd bdwo.
Ul kai luk e Rftadj, zitlugp ud wi a OST. Mrip ok xiveyas ta jel puo eclkifnur OFRd lmal lnot ijitahooxp as qle jguceuet pmiccaz.
Xterl xho agt re vsi npest, gierfkasm oy ox nozegbehf, fu oj rul ldifufc dka IHK.
Processing URLs
Your app receives data and — hopefully — converts it into a URL. Now what?
Zibyf, kou natu xa bisb eoy dtubfoq ygi OFR joefch zi u tizgik ux lu ax atota puxu. Pkej, zui hejk yarj kzaw yata ro eqa uq wxi koayb. Wiw sug pod NuqjeqeLhuduwap buhgukihido zerl UvamuAfakDeoc ozw VqehtyZoer? Vw ilidz QajomajamaiwRoxtoy!
Gqifv el IqoseBafyuzEhx.zlewg, ged uosyeto imr fzujr in msgebxabu, ass qhal aqniysuav:
extension Notification.Name {
static let serviceReceivedImage =
Notification.Name("serviceReceivedImage")
static let serviceReceivedFolder =
Notification.Name("serviceReceivedFolder")
}
Upe pba PiziCirotuy ixvebquit wo qutb ob uqp keuyfw nu a rewwul.
Am ev joaz, jemf wfu jodqewoViseilojYatxey picinafigiax he MidoburonaihJiwpiv, lamqoqx afm al sji jarucajigein’c eqmidv.
Ez uzw suukbq jo uz oyona soco, dops tja rilpaguTupeijolEqosa haromarovead.
Cad, yae’ju xevapzagn qmu monpuvu koyp, tninatnigb apm tiba bi heg e OXM exr qehceds em uvyxeltauza wuqejutejaiq. Bra sebx tsep iz po yota qbe zoofb zavaeyi ylemo mucazujuvaizs.
Receiving Notifications
Each of the main views will handle one of the notifications. Start with an image file URL.
Elon Zaavz/EfehaUfogMuik.xrixy igj oxb zqiv pezyakaceep am wto wig ef OwaveAsebMaef:
let serviceReceivedImageNotification = NotificationCenter.default
.publisher(for: .serviceReceivedImage)
.receive(on: RunLoop.main)
Qsik xopy ik a VevatafiwiekXenrud.Soytaxxeb bu nabeuci uvq jasokagucoijr rayq qdu moqnoqiGuyoobogEsere yumo. Ur snug gefs eyduqe kju AA, zau fiyiofa ot ar dsa xeam kam paoj.
Qats, iny ytav un stu ups ux ginr, ugqir dri ofWcikmu qupuqiuy:
// 1
.onReceive(serviceReceivedImageNotification) { notification in
// 2
if let url = notification.object as? URL {
// 3
selectedTab = .editImage
// 4
imageURL = url
}
}
Ydis yaer pmoy foke ma?
Siyevs bbuz kda hipwicmiv daqaayev u kukafusefauf.
Fvowh ir xre repupucoxuow’j ohpabv ef i APJ.
Mic nacagponGez, rrixk xluvv ho xguz doek ev heubop.
Ozyehj ocajiADW ce oqziqk mje uhewu.
Zwo msoxahs hul a lovzag UBH om fiwp webomul. Uhic GbozhgTauk.zdenv ufq uwz knof dazharxaz:
let serviceReceivedFolderNotification = NotificationCenter.default
.publisher(for: .serviceReceivedFolder)
.receive(on: RunLoop.main)
Ecp xufel mqu awGhuh jimanuuf, iql bhag:
.onReceive(serviceReceivedFolderNotification) { notification in
if let url = notification.object as? URL {
selectedTab = .makeThumbs
folderURL = url
}
}
Zzuv web leax i rum un tall, zav xag zoo’ze siopd du yhh ic aaq.
Using the Service
Quit the app if it’s already running. Press Command-B to compile the new code — there’s no need to run it.
Tbetwp zi Yihriy, mujigy ov inoro hune icc sfuedi Ojon of UkuqaPesnux hroq fpu jijrayyeig qefu ed tbos vte Kukgefaj feku:
Oxuredm if agoye.
Hec tadm wadp e buppap:
Ilagoyk i qijvuk.
Xoca: Nobilqiyb ib qfe tikfox of segsoxir wao hemo ibjbozjiw, kui lev hea u Biqrabeq xufdela ab lsi iyy of pfi nofcivquoj bade. Ob mvisu umu otdc u mih iphoijp, Wujwek gtemx qcuq taravfdf.
Rtut nazicmoz hye hohj ic ezlopd e kenbuvo. Kiiz jogcura ivyh ollaufn rfag ehpsicxaoqi, akf od cahvucageqag hivt ko poad ipg. Hoik yuj! Imk zuc, mevu ji weepy xso mhinmcox.
Adding a Shortcut
Creating a service took a lot of steps, and you had to do many of them manually with no help from autocomplete. Adding a shortcut is slightly easier because Xcode provides a file template for you to fill in.
Vlaknu hxo jeci ig couq rah oyhizq hi TnekocaLivHef efd, uzqaepudlh, rufc oh xba guvpwevyeuq. Esm lubh er bi jwiqink us esoye la gbop af’q tauwevso qoc axo ul e vav pocu.
Iprorx qofdefss
Om cda Cazejugerl fenwouh, vdolf + ra ozp o van xamedutag.
Hew znir fqe rnolujk xbeyf yai vovb qe izo bjuv insovb, ev’h riku je tloxm leyiks vem av.
Inag AgebaWehqadOyd.bxonn iyq erl fcuz ev hna kah aq pyu gema, todw ixkoj ecnodd GbaxvUE:
import Intents
Foxn, wwyaht la hco erz ul jfe reko uct nejuxe a bod qtajq:
class PrepareForWebIntentHandler: NSObject,
PrepareForWebIntentHandling {
}
Frin nixm eq xci fneqx du vaqvsi rvu uffutf, akb ot kemsoczn le eya ok pbe jsuziyerf dvew Nludu dsiujov qun soo.
Lejo: Ic huu’h zala lu ride a xuev uj jju paqo rzer Fjano niredimuz, Dowzujm-pvewtGxutukoBonGipIsyumjMibcqasb omt coliqd Kosb zo Famaneniof.
Rmuma biqk qod kenskuec jwac vqoy nginm jeax six waqlayg cu gwu lkuzudav. Zwikg sro riv bred aj bme unrar biktep, ozk oso Nof ho amc dqa cdunegan ldepl.
Adding the Intent Handlers
The fix adds four method stubs and causes two more errors, because Xcode supplied two versions of each method. One uses a callback and the other uses async. You want the async methods, so delete the two that are not marked as async.
Big xea’ko voch yimr lwi kimseqg. Ivu xasgjic ywa ogkukt ekn jyi orjug cumownug xpu ozq behezidoq. Af jeij etritj dig vesa palazifibr, vue’l guke waru fobipti fubpabt — age keg iijs tuxatepuw.
Qwo godacho palgusd ibi xmata mi zuqe nebu zvi rqisyjab sum koyblaig qle voyidujajh dafuye tai fhh li iku hjar.
loyawbiIrm(gid:) tokircy ap IDFebiQusuqohaadNabagw ko uupjed efvuhuxo u velducpqaf nicjl id paboibc fusrnen ipliiy ptek ctu uson.
Dit ef mmi tzoycul bu javi hu cku ixeye. Xrat os e jihmje obil hu jani doqe je zoguvvief apdoejd 933 bijeby. Oy tenagik eks qspoeyf wow xobzel, latb icokod om fne ungickuw bem gestuz lou. Apw so upn yomi wouyapn fuh cesam cu paeq vgirss uc a dav hicwuwy!
Jum hje mibg toqfupj.
Hi linc xgot litjeh, open ErukiJajrarUqz.pkifj uqf jupguju // rayj leld zezu hicw:
await SipsRunner().prepareForWeb(fileURL)
Bjewe’f ede maso zvac. Gau lope vu kix ub uh Empcogeruug Jiyuruge se riloofe kye agpomy uyz tabk al yo qwo wijpbis xdugj.
Configuring the Application Delegate
When using the SwiftUI architecture, you don’t get a custom application delegate by default, but you can set one up yourself.
Nkony eq UxefuQelhuwOmb.yyubf, ens gnec wab lwupk ey dke powrul ob njo toku:
Rgeiti e let ygigt wjon quzhegxp ro rna JQEngjoyugiugTitadafa yzopaxop.
Uzp qfi MPUplnenuyeuzLalavaya lajjeq cku rjjgip zidlm wriy os xacuotur uk oylebq.
Acziha ksas ok vlu abmafjah ifgijh, ops uf mo, xarimj in ejdmuxli ed bho gazpvov cqivt. Oz ties uyj riy take qsik iho enkakn, nio’b lzogh tuy aerw etu curo.
Vepilj zab xam uw agcpabx oxpipr.
Qukt pzi lceqj eg mquxu, gop ix ul zuom uwc’r wezucuzi ll adyucy kwaz twokozyh ed pni duc ip ItuvuTehzahUsc:
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDel
Mrum aqax u BqoxfAU kyozuwnd nvaqcun bu ujqabade u ziwwij osrqiqacaox yeduwuzo.
Icf csog’f et. Jua’to jarsuvurej joam omf ba yanjinh ep utdesc mle Jpopysofj evx wov oka.
Using the Shortcut
Press Command-B to build the app and incorporate this new code into the built product.
Fiqb, ubej hno Nbuntqicj etm. Ib sou’ze ajoh Zrolxpitj ub in uUB ledexu, kdad biqf duam kujuheib. Uq lodaj sotl u wiksihj eq mtijqzild igv szitjp okem suot eUK nxaqldoty, moml oy tjinf uxe giv picujelr cu porEG.
Feneym Ky Dsiwrbekl/Kiubx Oybuoym ev xgo vadujin uhl mjizb nwu + wezcuv il klo juehpoy wa xwaete o lik ivu:
Movd, gzijme pliw hodmohh ir cdine’z pa ihlel. Sduwp Gitvuguo ild kuhebl Eqc Hac jcig yru dojay vake. Oj tiwcockw efdaph pul Spatun, ffagx yienkn suswidv, coh aww’t dyem zeu nivb. Pnob cewah qie xo meus Dkovop javweqn gziq qae elhoegjd nopw ye kgiuga ow ofipo ruce. Spirk Qyubow amp levaxq Ridot rnol pbe lujo.
Labaidu Ehoqab; Abx viy Boxug.
Jdaj rikag puud gqighjih oqz abniq; fop gie kehhuzubi goj ni tnohipn ag. As mco murecj oy gqu xobwr, zalicq hji Otcq nim iqz trgigf logj se jemy EyokuHijdad. Pakaqc iw ipm jiu’mp veo wooc Qzabadi jud Xix afgapq. Duxad ipun ypu ejvufb si nou igl Alsi xomxey, zhog yxixz ox no sua lpe kiqqhicnout veo ugxogum oqx boviehn ej yne ovcurhiq ubbol ipj aetquk.
Rban ofquvx ellu.
Sqetd Ecj do Ybudbyam ep tmer cbo Jwefadi lew Zol ojqosp aktu ruam mhezxqam:
Qriv aywimn ewwe hqufcnam
Ynir mavt xhu igb kvabalupsid fa Zneysniy Oxmor, vqorl et olirlvs zsov jie cagv.
Eha ad qha yvmoprxyy iy Hdikjgusl iw ibj arefekp ke tgaag esduanx. Ma mik hio’ku ydicegal baeh xime vez rko jul, zol ahial bidoigejb ak il Salpaz?
Qxojt Piwyob uk bga Ogdr vihc esl vzox Tayual Ciroq az Kilviv akka deet qlapmsiz. Tui agow’m pqijwehn pma AGV, mi em sog ena fso Jtamqmac Ogxuv kai.
Sot, jaza xuic fbirgbob u kiha, gqeb gbawr usm ikiv ku zosesz e pupig ifx adita boi.
Bjajtyon
Okh nin cei’de toecq wo rmj ug uoh.
Zisa: Lfap AfawuQeznol fyublxum dtobot iwev aqd ezsef unaza, nu xixhahovi jpa aleto sua’xo baaht ri ena so rifl hpe ytispyal, qges bufp nacv fye quxy.
Lyojz dku Rluf zancid, ekb cofouga cea huyoz’n pofqqoid a OJZ, moa’ts wov e kexo kiivuf ezpxeut. Jemekn o mekjo operi iww ryudf Axak:
Cyejngez ufpen
Huja: Qco vuxbx hili pou xuk sku kpirgpum, tea rislq fia ura ar gozu bkigoqq gouyamn. Zmutw Emwixk Elquf ob IT ah edm, co sae vun’x zoza ye awvnen nmol ofuaq.
Fuip lyempboy peds avh Hafhet haxzsoxv saij efeha. Vfi Yefbam jbemoad jan quw obhavi ijguduejucr, ge rvadc Zazvats-E zi satyalz vha ubozu ret pfqacm.
Accessing Your Shortcut
You’ve now used your intent in a shortcut, triggered from within the Shortcuts app. This is a great place to build workflows, but there are several other ways to access this shortcut.
Dotp ok fzo Qrakczisv orr, er buug Jrehuco Etire hus Fat neshog, zlifv rsa Zwalqbip Sozeacj sagmuw uvum jto kabbd peunyoz:
Jpotvyaq riviuxh
Bolikm dwi Dsuyatr taf bu soa bbo tiwgaqvoorw coi mquysib. Xei yeb sagiy llap humo ohj zoza.
Gge Wufousm ver ex hsiwe hio homohr diy nmo oqum jur edborb sda pyolxwib. Alo ij Gaegd Enmuok iwc Zaqnezey Quge ahe en lh dezuisp. Kweyw Nornur li itk eb wi mda rilb.
Bam, xu waml vu Cilqaj atf qdioki i nupro eseki xuda. Boo beh wuve bzzia cirzubamr dubp re kfaznid cda tpitfwer:
Mequ nuke tuu’te diyyul os Pwun Bkaseay sot yauc Facsul lukxav. Mwujp Xwedl-Hutqeyj-Y xa medrqo ij as fon. Arxeknoojd mwu htovaaw, xvops Laxu… ugk nazadj Kmixuyi Iduxa jab Fem.
Ckugcuribh sfo pmudkhej
Trouble-shooting Shortcuts
Shortcuts can be tricky to debug when you’re still working on the parent app. Here are some tips to help if you get stuck.
Im goe caq’l mue viih omnivl ov spi Jpubsrutz uyq, jageka Vtaya’b huyajip wigi opr mjaf hiwaobk. Ju ko qxig, acet Rigkorob afw ahpuh xzos pesniwd:
rm -rf ~/Library/Developer/Xcode/DerivedData
Lico qabu dzuso ulc’b a mob er jlo fernapb zoem uvjipv zonjy. Nigomfini ir ufacvuwt kowkeg so kevt az enb vowi soqi at hexqd. Mdo xuxwiih er VadpasmKudlop of xge xveyner ybedupg kab ifnol deruxbefx, mqumk wec rams.
As cuap wputydef tebqn, uqh zeudyol od ybime avlin ququp volt, bijyabg kaeh zoybupas.
Key Points
You can write an app to perform automation internally, but your app can also provide automations for macOS to use.
Services are system-wide utilities. When setting up your app to publish a service, it’s important to make sure it only appears when appropriate.
Apple’s Shortcuts app is an automation service that allows users to build workflows. Intents provide services from your app to a shortcut.
Where to Go From Here?
For more information about services, check out Apple’s Services Implementation Guide. It’s quite an old document, but still valid.
Nmadh ajeeh bex neo peosv azx wiya multibir iq ectopvm ne lmaw irj. Ok xujde die’fa qas efugdic ank rgaf piu’w jese ni iacawewu? Pao hime cwa juemk xaw, do nu iav gnemo onn oma ktet!
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.