raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.37k stars 3.07k forks source link

[Apple Notes] ... #1896

Closed greg-nelson closed 2 years ago

greg-nelson commented 2 years ago

Extension – Apple Notes

Author: @tumispro

Description

I just selected the Search Notes command and waited for the "progress bar" at the top to stop moving. I got the error message without taking any further action.

Error:

Error: Command failed with exit code 1: osascript -e 
    tell application "Notes" to activate
    tell application "System Events" to tell process "Notes" to ¬
    click menu item 1 of menu 1 of ¬
    menu bar item 3 of menu bar 1

112:178: execution error: System Events got an error: AppleEvent timed out. (-1712)

    tell application "Notes" to activate
    tell application "System Events" to tell process "Notes" to ¬
    click menu item 1 of menu 1 of ¬
    menu bar item 3 of menu bar 1

112:178: execution error: System Events got an error: AppleEvent timed out. (-1712)
xr:new.js:5:57

---
2: `:`
3: `.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}});var bt=a((Ls,k)=>{"use strict";var _=require("path"),gt=te(),xt=e=>{e=f({cwd:process.cwd(),path:process.env[gt()],execPath:process.execPath},e);let t,n=_.resolve(e.cwd),r=[];for(;t!==n;)r.push(_.join(n,"node_modules/.bin")),t=n,n=_.resolve(n,"..");let s=_.resolve(e.cwd,e.execPath,"..");return r.push(s),r.concat(e.path).join(_.delimiter)};k.exports=xt;k.exports.default=xt;k.exports.env=e=>{e=f({env:process.env},e);let t=f({},e.env),n=gt({env:t});return e.path=t[n],t[n]=k.exports(e),t}});var vt=a((Ms,ue)=>{"use strict";var wt=(e,t)=>{for(let n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};ue.exports=wt;ue.exports.default=wt});var It=a((js,D)=>{"use strict";var Jn=vt(),U=new WeakMap,Et=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,s=e.displayName||e.name||"<anonymous>",o=function(...i){if(U.set(o,++r),r===1)n=e.apply(this,i),e=null;else if(t.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return n};return Jn(o,e),U.set(o,r),o};D.exports=Et;D.exports.default=Et;D.exports.callCount=e=>{if(!U.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return U.get(e)}});var Tt=a(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.SIGNALS=void 0;var er=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];X.SIGNALS=er});var le=a(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.SIGRTMAX=G.getRealtimeSignals=void 0;var tr=function(){let e=Gt-Pt+1;return Array.from({length:e},nr)};G.getRealtimeSignals=tr;var nr=function(e,t){return{name:`SIGRT${t+1}`,number:Pt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Pt=34,Gt=64;G.SIGRTMAX=Gt});var Ct=a(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.getSignals=void 0;var rr=require("os"),sr=Tt(),or=le(),ir=function(){let e=(0,or.getRealtimeSignals)();return[...sr.SIGNALS,...e].map(cr)};H.getSignals=ir;var cr=function({name:e,number:t,description:n,action:r,forced:s=!1,standard:o}){let{signals:{[e]:i}}=rr.constants,c=i!==void 0;return{name:e,number:c?i:t,description:n,supported:c,action:r,forced:s,standard:o}}});var Ot=a(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.signalsByNumber=C.signalsByName=void 0;var ar=require("os"),At=Ct(),ur=le(),lr=function(){return(0,At.getSignals)().reduce(dr,{})},dr=function(e,{name:t,number:n,description:r,supported:s,action:o,forced:i,standard:c}){return w(f({},e),{[t]:{name:t,number:n,description:r,supported:s,action:o,forced:i,standard:c}})},fr=lr();C.signalsByName=fr;var pr=function(){let e=(0,At.getSignals)(),t=ur.SIGRTMAX+1,n=Array.from({length:t},(r,s)=>mr(s,e));return Object.assign({},...n)},mr=function(e,t){let n=hr(e,t);if(n===void 0)return{};let{name:r,description:s,supported:o,action:i,forced:c,standard:u}=n;return{[e]:{name:r,number:e,description:s,supported:o,action:i,forced:c,standard:u}}},hr=function(e,t){let n=t.find(({name:r})=>ar.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},Sr=pr();C.signalsByNumber=Sr});var qt=a((Hs,Rt)=>{"use strict";var{signalsByName:yr}=Ot(),gr=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:s,exitCode:o,isCanceled:i})=>e?`timed out after ${t} milliseconds`:i?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${s})`:o!==void 0?`failed with exit code ${o}`:"failed",xr=({stdout:e,stderr:t,all:n,error:r,signal:s,exitCode:o,command:i,escapedCommand:c,timedOut:u,isCanceled:l,killed:p,parsed:{options:{timeout:S}}})=>{o=o===null?void 0:o,s=s===null?void 0:s;let h=s===void 0?void 0:yr[s].description,y=r&&r.code,x=`Command ${gr({timedOut:u,timeout:S,errorCode:y,signal:s,signalDescription:h,exitCode:o,isCanceled:l})}: ${i}`,I=Object.prototype.toString.call(r)==="[object Error]",M=I?`${x}
4: ${r.message}`:x,j=[M,t,e].filter(Boolean).join(`
5: `);return I?(r.originalMessage=r.message,r.message=j):r=new Error(j),r.shortMessage=M,r.command=i,r.escapedCommand=c,r.exitCode=o,r.signal=s,r.signalDescription=h,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=Boolean(u),r.isCanceled=l,r.killed=p&&!u,r};Rt.exports=xr});var _t=a((Ks,de)=>{"use strict";var K=["stdin","stdout","stderr"],br=e=>K.some(t=>e[t]!==void 0),Nt=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return K.map(r=>e[r]);if(br(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${K.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,K.length);return Array.from({length:n},(r,s)=>t[s])};de.exports=Nt;de.exports.node=e=>{let t=Nt(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var kt=a((Ws,W)=>{W.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&W.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&W.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var jt=a((zs,R)=>{var d=global.process,v=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};v(d)?($t=require("assert"),A=kt(),Bt=/^win/i.test(d.platform),$=require("events"),typeof $!="function"&&($=$.EventEmitter),d.__signal_exit_emitter__?m=d.__signal_exit_emitter__:(m=d.__signal_exit_emitter__=new $,m.count=0,m.emitted={}),m.infinite||(m.setMaxListeners(1/0),m.infinite=!0),R.exports=function(e,t){if(!v(global.process))return function(){};$t.equal(typeof e,"function","a callback must be provided for exit handler"),O===!1&&fe();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){m.removeListener(n,e),m.listeners("exit").length===0&&m.listeners("afterexit").length===0&&z()};return m.on(n,e),r},z=function(){!O||!v(global.process)||(O=!1,A.forEach(function(t){try{d.removeListener(t,V[t])}catch{}}),d.emit=Y,d.reallyExit=pe,m.count-=1)},R.exports.unload=z,E=function(t,n,r){m.emitted[t]||(m.emitted[t]=!0,m.emit(t,n,r))},V={},A.forEach(function(e){V[e]=function(){if(!!v(global.process)){var n=d.listeners(e);n.length===m.count&&(z(),E("exit",null,e),E("afterexit",null,e),Bt&&e==="SIGHUP"&&(e="SIGINT"),d.kill(d.pid,e))}}}),R.exports.signals=function(){return A},O=!1,fe=function(){O||!v(global.process)||(O=!0,m.count+=1,A=A.filter(function(t){try{return d.on(t,V[t]),!0}catch{return!1}}),d.emit=Mt,d.reallyExit=Lt)},R.exports.load=fe,pe=d.reallyExit,Lt=function(t){!v(global.process)||(d.exitCode=t||0,E("exit",d.exitCode,null),E("afterexit",d.exitCode,null),pe.call(d,d.exitCode))},Y=d.emit,Mt=function(t,n){if(t==="exit"&&v(global.process)){n!==void 0&&(d.exitCode=n);var r=Y.apply(this,arguments);return E("exit",d.exitCode,null),E("afterexit",d.exitCode,null),r}else return Y.apply(this,arguments)}):R.exports=function(){return function(){}};var $t,A,Bt,$,m,z,E,V,O,fe,pe,Lt,Y,Mt});var Ut=a((Vs,Ft)=>{"use strict";var wr=require("os"),vr=jt(),Er=1e3*5,Ir=(e,t="SIGTERM",n={})=>{let r=e(t);return Tr(e,t,n,r),r},Tr=(e,t,n,r)=>{if(!Pr(t,n,r))return;let s=Cr(n),o=setTimeout(()=>{e("SIGKILL")},s);o.unref&&o.unref()},Pr=(e,{forceKillAfterTimeout:t},n)=>Gr(e)&&t!==!1&&n,Gr=e=>e===wr.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Cr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Er;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ar=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Or=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Rr=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let s,o=new Promise((c,u)=>{s=setTimeout(()=>{Or(e,n,u)},t)}),i=r.finally(()=>{clearTimeout(s)});return Promise.race([o,i])},qr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Nr=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let s=vr(()=>{e.kill()});return r.finally(()=>{s()})};Ft.exports={spawnedKill:Ir,spawnedCancel:Ar,setupTimeout:Rr,validateTimeout:qr,setExitHandler:Nr}});var Xt=a((Ys,Dt)=>{"use strict";var b=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";b.writable=e=>b(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";b.readable=e=>b(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";b.duplex=e=>b.writable(e)&&b.readable(e);b.transform=e=>b.duplex(e)&&typeof e._transform=="function";Dt.exports=b});var Kt=a((Qs,Ht)=>{"use strict";var{PassThrough:_r}=require("stream");Ht.exports=e=>{e=f({},e);let{array:t}=e,{encoding:n}=e,r=n==="buffer",s=!1;t?s=!(n||r):n=n||"utf8",r&&(n=null);let o=new _r({objectMode:s});n&&o.setEncoding(n);let i=0,c=[];return o.on("data",u=>{c.push(u),s?i=c.length:i+=u.length}),o.getBufferedValue=()=>t?c:r?Buffer.concat(c,i):c.join(""),o.getBufferedLength=()=>i,o}});var Wt=a((Zs,B)=>{"use strict";var{constants:kr}=require("buffer"),$r=require("stream"),{promisify:Br}=require("util"),Lr=Kt(),Mr=Br($r.pipeline),me=class extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}};async function he(e,t){if(!e)throw new Error("Expected a stream");t=f({maxBuffer:1/0},t);let{maxBuffer:n}=t,r=Lr(t);return await new Promise((s,o)=>{let i=c=>{c&&r.getBufferedLength()<=kr.MAX_LENGTH&&(c.bufferedData=r.getBufferedValue()),o(c)};(async()=>{try{await Mr(e,r),s()}catch(c){i(c)}})(),r.on("data",()=>{r.getBufferedLength()>n&&i(new me)})}),r.getBufferedValue()}B.exports=he;B.exports.buffer=(e,t)=>he(e,w(f({},t),{encoding:"buffer"}));B.exports.array=(e,t)=>he(e,w(f({},t),{array:!0}));B.exports.MaxBufferError=me});var Vt=a((Js,zt)=>{"use strict";var{PassThrough:jr}=require("stream");zt.exports=function(){var e=[],t=new jr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",s),Array.prototype.slice.call(arguments).forEach(n),t;function n(o){return Array.isArray(o)?(o.forEach(n),this):(e.push(o),o.once("end",s.bind(null,o)),o.once("error",t.emit.bind(t,"error")),o.pipe(t,{end:!1}),this)}function r(){return e.length==0}function s(o){e=e.filter(function(i){return i!==o}),!e.length&&t.readable&&t.end()}}});var Jt=a((eo,Zt)=>{"use strict";var Qt=Xt(),Yt=Wt(),Fr=Vt(),Ur=(e,t)=>{t===void 0||e.stdin===void 0||(Qt(t)?t.pipe(e.stdin):e.stdin.end(t))},Dr=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=Fr();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},Se=async(e,t)=>{if(!!e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},ye=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?Yt(e,{encoding:t,maxBuffer:r}):Yt.buffer(e,{maxBuffer:r})},Xr=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:s,maxBuffer:o},i)=>{let c=ye(e,{encoding:r,buffer:s,maxBuffer:o}),u=ye(t,{encoding:r,buffer:s,maxBuffer:o}),l=ye(n,{encoding:r,buffer:s,maxBuffer:o*2});try{return await Promise.all([i,c,u,l])}catch(p){return Promise.all([{error:p,signal:p.signal,timedOut:p.timedOut},Se(e,c),Se(t,u),Se(n,l)])}},Hr=({input:e})=>{if(Qt(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};Zt.exports={handleInput:Ur,makeAllStream:Dr,getSpawnedResult:Xr,validateInputSync:Hr}});var tn=a((to,en)=>{"use strict";var Kr=(async()=>{})().constructor.prototype,Wr=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Kr,e)]),zr=(e,t)=>{for(let[n,r]of Wr){let s=typeof t=="function"?(...o)=>Reflect.apply(r.value,t(),o):r.value.bind(t);Reflect.defineProperty(e,n,w(f({},r),{value:s}))}return e},Vr=e=>new Promise((t,n)=>{e.on("exit",(r,s)=>{t({exitCode:r,signal:s})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});en.exports={mergePromise:zr,getSpawnedPromise:Vr}});var sn=a((no,rn)=>{"use strict";var nn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Yr=/^[\w.-]+$/,Qr=/"/g,Zr=e=>typeof e!="string"||Yr.test(e)?e:`"${e.replace(Qr,'\\"')}"`,Jr=(e,t)=>nn(e,t).join(" "),es=(e,t)=>nn(e,t).map(n=>Zr(n)).join(" "),ts=/ +/g,ns=e=>{let t=[];for(let n of e.trim().split(ts)){let r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};rn.exports={joinCommand:Jr,getEscapedCommand:es,parseCommand:ns}});var fn=a((ro,q)=>{"use strict";var rs=require("path"),ge=require("child_process"),ss=ht(),os=yt(),is=bt(),cs=It(),Q=qt(),cn=_t(),{spawnedKill:as,spawnedCancel:us,setupTimeout:ls,validateTimeout:ds,setExitHandler:fs}=Ut(),{handleInput:ps,getSpawnedResult:ms,makeAllStream:hs,validateInputSync:Ss}=Jt(),{mergePromise:on,getSpawnedPromise:ys}=tn(),{joinCommand:an,parseCommand:un,getEscapedCommand:ln}=sn(),gs=1e3*1e3*100,xs=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:s})=>{let o=t?f(f({},process.env),e):e;return n?is.env({env:o,cwd:r,execPath:s}):o},dn=(e,t,n={})=>{let r=ss._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n=f({maxBuffer:gs,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0},n),n.env=xs(n),n.stdio=cn(n),process.platform==="win32"&&rs.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},L=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?os(t):t,Z=(e,t,n)=>{let r=dn(e,t,n),s=an(e,t),o=ln(e,t);ds(r.options);let i;try{i=ge.spawn(r.file,r.args,r.options)}catch(y){let g=new ge.ChildProcess,x=Promise.reject(Q({error:y,stdout:"",stderr:"",all:"",command:s,escapedCommand:o,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return on(g,x)}let c=ys(i),u=ls(i,r.options,c),l=fs(i,r.options,u),p={isCanceled:!1};i.kill=as.bind(null,i.kill.bind(i)),i.cancel=us.bind(null,i,p);let h=cs(async()=>{let[{error:y,exitCode:g,signal:x,timedOut:I},M,j,yn]=await ms(i,r.options,l),xe=L(r.options,M),be=L(r.options,j),we=L(r.options,yn);if(y||g!==0||x!==null){let ve=Q({error:y,exitCode:g,signal:x,stdout:xe,stderr:be,all:we,command:s,escapedCommand:o,parsed:r,timedOut:I,isCanceled:p.isCanceled,killed:i.killed});if(!r.options.reject)return ve;throw ve}return{command:s,escapedCommand:o,exitCode:0,stdout:xe,stderr:be,all:we,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return ps(i,r.options.input),i.all=hs(i,r.options),on(i,h)};q.exports=Z;q.exports.sync=(e,t,n)=>{let r=dn(e,t,n),s=an(e,t),o=ln(e,t);Ss(r.options);let i;try{i=ge.spawnSync(r.file,r.args,r.options)}catch(l){throw Q({error:l,stdout:"",stderr:"",all:"",command:s,escapedCommand:o,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let c=L(r.options,i.stdout,i.error),u=L(r.options,i.stderr,i.error);if(i.error||i.status!==0||i.signal!==null){let l=Q({stdout:c,stderr:u,error:i.error,signal:i.signal,exitCode:i.status,command:s,escapedCommand:o,parsed:r,timedOut:i.error&&i.error.code==="ETIMEDOUT",isCanceled:!1,killed:i.signal!==null});if(!r.options.reject)return l;throw l}return{command:s,escapedCommand:o,exitCode:0,stdout:c,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};q.exports.command=(e,t)=>{let[n,...r]=un(e);return Z(n,r,t)};q.exports.commandSync=(e,t)=>{let[n,...r]=un(e);return Z.sync(n,r,t)};q.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);let r=cn.node(n),s=process.execArgv.filter(c=>!c.startsWith("--inspect")),{nodePath:o=process.execPath,nodeOptions:i=s}=n;return Z(o,[...i,e,...Array.isArray(t)?t:[]],w(f({},n),{stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1}))}});var ws={};Tn(ws,{default:()=>bs});var Sn=require("@raycast/api");var pn=Ce(require("node:process"),1),mn=Ce(fn(),1);async function hn(e){if(pn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await(0,mn.default)("osascript",["-e",e]);return t}var bs=async()=>{await(0,Sn.closeMainWindow)(),await hn(`
6:     tell application "Notes" to activate
7:     tell application "System Events" to tell process "Notes" to \xAC
8:     click menu item 1 of menu 1 of \xAC
---

new.js:5:10386
processTicksAndRejections:task_queues:96:5
async hn:new.js:5:12142
async Object.bs:new.js:5:12240
async MessagePort.<anonymous>:index.js:1:2480

Steps To Reproduce

1. 2.

The current behavior

The expected behavior

Raycast version

Version: 1.35.2

tumispro commented 2 years ago

Heya! The error is a timeout of the underlying AppleScript. Does the command (try to) open the Notes app?

tumispro commented 2 years ago

Oh you're talking about the search function. But the error seems to be caused by the 'New Note' function. Does is consistently give this error?

ron-myers commented 2 years ago

@greg-nelson - there is a new approach to capturing iCloud Apple Notes (does not work for local-only notes) - you can follow along with its merge status here https://github.com/raycast/extensions/pull/2214

ron-myers commented 2 years ago

@mathieudutour - with https://github.com/raycast/extensions/pull/2214 I think we can close this issue.