raycast / extensions

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

[Extension Bug] Apple Notes: `New Note` leads to crash #785

Closed fogbring closed 2 years ago

fogbring commented 2 years ago

Extension – Apple Notes

Author: @tumispro

Description

image image

Steps To Reproduce

  1. New note
  2. Crash

The current behavior

The expected behavior

Raycast version

Version:

tumispro commented 2 years ago

This currently works by opening the Notes app and triggering a 'New Note' action. Can you perhaps tell me what folder is selected or what is visible if you open the Notes app? Perhaps I can improve the feature by setting the correct / preferred folder (using preferences) first.

tumispro commented 2 years ago

Sharing the log here as the screenshot suggests would be helpful too

Andrew-Tuen commented 2 years ago

Also crashed on my Mac. Following are the logs

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 "New Note" of menu 1 of ¬
menu bar item "File" of menu bar 1
100:176: execution error: “System Events”遇到一个错误:不能获得“menu bar item "File" of menu bar 1 of process "Notes"”。 (-1728)

tell application "System Events" to tell process "Notes" to ¬
click menu item "New Note" of menu 1 of ¬
menu bar item "File" of menu bar 1
100:176: execution error: “System Events”遇到一个错误:不能获得“menu bar item "File" of menu bar 1 of process "Notes"”。 (-1728)
fr:new.js:5:57

---
2: `:`
3: `.charCodeAt(),r=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e}});var ht=a((Rs,q)=>{"use strict";var R=require("path"),pt=J(),mt=e=>{e={cwd:process.cwd(),path:process.env[pt()],execPath:process.execPath,...e};let t,r=R.resolve(e.cwd),n=[];for(;t!==r;)n.push(R.join(r,"node_modules/.bin")),t=r,r=R.resolve(r,"..");let s=R.resolve(e.cwd,e.execPath,"..");return n.push(s),n.concat(e.path).join(R.delimiter)};q.exports=mt;q.exports.default=mt;q.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=pt({env:t});return e.path=t[r],t[r]=q.exports(e),t}});var yt=a((qs,ce)=>{"use strict";var St=(e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e};ce.exports=St;ce.exports.default=St});var xt=a((Ns,F)=>{"use strict";var Kn=yt(),j=new WeakMap,gt=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,s=e.displayName||e.name||"<anonymous>",o=function(...i){if(j.set(o,++n),n===1)r=e.apply(this,i),e=null;else if(t.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return Kn(o,e),j.set(o,n),o};F.exports=gt;F.exports.default=gt;F.exports.callCount=e=>{if(!j.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return j.get(e)}});var bt=a(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.SIGNALS=void 0;var Wn=[{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"}];U.SIGNALS=Wn});var ae=a(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.SIGRTMAX=T.getRealtimeSignals=void 0;var zn=function(){let e=vt-wt+1;return Array.from({length:e},Vn)};T.getRealtimeSignals=zn;var Vn=function(e,t){return{name:`SIGRT${t+1}`,number:wt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},wt=34,vt=64;T.SIGRTMAX=vt});var Et=a(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.getSignals=void 0;var Yn=require("os"),Qn=bt(),Zn=ae(),Jn=function(){let e=(0,Zn.getRealtimeSignals)();return[...Qn.SIGNALS,...e].map(er)};D.getSignals=Jn;var er=function({name:e,number:t,description:r,action:n,forced:s=!1,standard:o}){let{signals:{[e]:i}}=Yn.constants,c=i!==void 0;return{name:e,number:c?i:t,description:r,supported:c,action:n,forced:s,standard:o}}});var Tt=a(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.signalsByNumber=P.signalsByName=void 0;var tr=require("os"),It=Et(),nr=ae(),rr=function(){return(0,It.getSignals)().reduce(sr,{})},sr=function(e,{name:t,number:r,description:n,supported:s,action:o,forced:i,standard:c}){return{...e,[t]:{name:t,number:r,description:n,supported:s,action:o,forced:i,standard:c}}},or=rr();P.signalsByName=or;var ir=function(){let e=(0,It.getSignals)(),t=nr.SIGRTMAX+1,r=Array.from({length:t},(n,s)=>cr(s,e));return Object.assign({},...r)},cr=function(e,t){let r=ar(e,t);if(r===void 0)return{};let{name:n,description:s,supported:o,action:i,forced:c,standard:u}=r;return{[e]:{name:n,number:e,description:s,supported:o,action:i,forced:c,standard:u}}},ar=function(e,t){let r=t.find(({name:n})=>tr.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},ur=ir();P.signalsByNumber=ur});var Gt=a((Ls,Pt)=>{"use strict";var{signalsByName:lr}=Tt(),dr=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:s,exitCode:o,isCanceled:i})=>e?`timed out after ${t} milliseconds`:i?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${s})`:o!==void 0?`failed with exit code ${o}`:"failed",fr=({stdout:e,stderr:t,all:r,error:n,signal:s,exitCode:o,command:i,escapedCommand:c,timedOut:u,isCanceled:l,killed:f,parsed:{options:{timeout:h}}})=>{o=o===null?void 0:o,s=s===null?void 0:s;let m=s===void 0?void 0:lr[s].description,S=n&&n.code,g=`Command ${dr({timedOut:u,timeout:h,errorCode:S,signal:s,signalDescription:m,exitCode:o,isCanceled:l})}: ${i}`,v=Object.prototype.toString.call(n)==="[object Error]",$=v?`${g}
4: ${n.message}`:g,B=[$,t,e].filter(Boolean).join(`
5: `);return v?(n.originalMessage=n.message,n.message=B):n=new Error(B),n.shortMessage=$,n.command=i,n.escapedCommand=c,n.exitCode=o,n.signal=s,n.signalDescription=m,n.stdout=e,n.stderr=t,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=Boolean(u),n.isCanceled=l,n.killed=f&&!u,n};Pt.exports=fr});var At=a((Ms,ue)=>{"use strict";var X=["stdin","stdout","stderr"],pr=e=>X.some(t=>e[t]!==void 0),Ct=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return X.map(n=>e[n]);if(pr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${X.map(n=>`\`${n}\``).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 r=Math.max(t.length,X.length);return Array.from({length:r},(n,s)=>t[s])};ue.exports=Ct;ue.exports.node=e=>{let t=Ct(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var Ot=a((js,H)=>{H.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&H.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&H.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var kt=a((Fs,A)=>{var d=global.process,b=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"};b(d)?(Rt=require("assert"),G=Ot(),qt=/^win/i.test(d.platform),N=require("events"),typeof N!="function"&&(N=N.EventEmitter),d.__signal_exit_emitter__?p=d.__signal_exit_emitter__:(p=d.__signal_exit_emitter__=new N,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),A.exports=function(e,t){if(!!b(global.process)){Rt.equal(typeof e,"function","a callback must be provided for exit handler"),C===!1&&le();var r="exit";t&&t.alwaysLast&&(r="afterexit");var n=function(){p.removeListener(r,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&K()};return p.on(r,e),n}},K=function(){!C||!b(global.process)||(C=!1,G.forEach(function(t){try{d.removeListener(t,W[t])}catch{}}),d.emit=z,d.reallyExit=de,p.count-=1)},A.exports.unload=K,w=function(t,r,n){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,r,n))},W={},G.forEach(function(e){W[e]=function(){if(!!b(global.process)){var r=d.listeners(e);r.length===p.count&&(K(),w("exit",null,e),w("afterexit",null,e),qt&&e==="SIGHUP"&&(e="SIGINT"),d.kill(d.pid,e))}}}),A.exports.signals=function(){return G},C=!1,le=function(){C||!b(global.process)||(C=!0,p.count+=1,G=G.filter(function(t){try{return d.on(t,W[t]),!0}catch{return!1}}),d.emit=_t,d.reallyExit=Nt)},A.exports.load=le,de=d.reallyExit,Nt=function(t){!b(global.process)||(d.exitCode=t||0,w("exit",d.exitCode,null),w("afterexit",d.exitCode,null),de.call(d,d.exitCode))},z=d.emit,_t=function(t,r){if(t==="exit"&&b(global.process)){r!==void 0&&(d.exitCode=r);var n=z.apply(this,arguments);return w("exit",d.exitCode,null),w("afterexit",d.exitCode,null),n}else return z.apply(this,arguments)}):A.exports=function(){};var Rt,G,qt,N,p,K,w,W,C,le,de,Nt,z,_t});var Bt=a((Us,$t)=>{"use strict";var mr=require("os"),hr=kt(),Sr=1e3*5,yr=(e,t="SIGTERM",r={})=>{let n=e(t);return gr(e,t,r,n),n},gr=(e,t,r,n)=>{if(!xr(t,r,n))return;let s=wr(r),o=setTimeout(()=>{e("SIGKILL")},s);o.unref&&o.unref()},xr=(e,{forceKillAfterTimeout:t},r)=>br(e)&&t!==!1&&r,br=e=>e===mr.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",wr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Sr;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},vr=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Er=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Ir=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let s,o=new Promise((c,u)=>{s=setTimeout(()=>{Er(e,r,u)},t)}),i=n.finally(()=>{clearTimeout(s)});return Promise.race([o,i])},Tr=({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})`)},Pr=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let s=hr(()=>{e.kill()});return n.finally(()=>{s()})};$t.exports={spawnedKill:yr,spawnedCancel:vr,setupTimeout:Ir,validateTimeout:Tr,setExitHandler:Pr}});var Mt=a((Ds,Lt)=>{"use strict";var x=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";x.writable=e=>x(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";x.readable=e=>x(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";x.duplex=e=>x.writable(e)&&x.readable(e);x.transform=e=>x.duplex(e)&&typeof e._transform=="function";Lt.exports=x});var Ft=a((Xs,jt)=>{"use strict";var{PassThrough:Gr}=require("stream");jt.exports=e=>{e={...e};let{array:t}=e,{encoding:r}=e,n=r==="buffer",s=!1;t?s=!(r||n):r=r||"utf8",n&&(r=null);let o=new Gr({objectMode:s});r&&o.setEncoding(r);let i=0,c=[];return o.on("data",u=>{c.push(u),s?i=c.length:i+=u.length}),o.getBufferedValue=()=>t?c:n?Buffer.concat(c,i):c.join(""),o.getBufferedLength=()=>i,o}});var Ut=a((Hs,_)=>{"use strict";var{constants:Cr}=require("buffer"),Ar=require("stream"),{promisify:Or}=require("util"),Rr=Ft(),qr=Or(Ar.pipeline),fe=class extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}};async function pe(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:r}=t,n=Rr(t);return await new Promise((s,o)=>{let i=c=>{c&&n.getBufferedLength()<=Cr.MAX_LENGTH&&(c.bufferedData=n.getBufferedValue()),o(c)};(async()=>{try{await qr(e,n),s()}catch(c){i(c)}})(),n.on("data",()=>{n.getBufferedLength()>r&&i(new fe)})}),n.getBufferedValue()}_.exports=pe;_.exports.buffer=(e,t)=>pe(e,{...t,encoding:"buffer"});_.exports.array=(e,t)=>pe(e,{...t,array:!0});_.exports.MaxBufferError=fe});var Xt=a((Ks,Dt)=>{"use strict";var{PassThrough:Nr}=require("stream");Dt.exports=function(){var e=[],t=new Nr({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",s),Array.prototype.slice.call(arguments).forEach(r),t;function r(o){return Array.isArray(o)?(o.forEach(r),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 n(){return e.length==0}function s(o){e=e.filter(function(i){return i!==o}),!e.length&&t.readable&&t.end()}}});var zt=a((Ws,Wt)=>{"use strict";var Kt=Mt(),Ht=Ut(),_r=Xt(),kr=(e,t)=>{t===void 0||e.stdin===void 0||(Kt(t)?t.pipe(e.stdin):e.stdin.end(t))},$r=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=_r();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},me=async(e,t)=>{if(!!e){e.destroy();try{return await t}catch(r){return r.bufferedData}}},he=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?Ht(e,{encoding:t,maxBuffer:n}):Ht.buffer(e,{maxBuffer:n})},Br=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:s,maxBuffer:o},i)=>{let c=he(e,{encoding:n,buffer:s,maxBuffer:o}),u=he(t,{encoding:n,buffer:s,maxBuffer:o}),l=he(r,{encoding:n,buffer:s,maxBuffer:o*2});try{return await Promise.all([i,c,u,l])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},me(e,c),me(t,u),me(r,l)])}},Lr=({input:e})=>{if(Kt(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};Wt.exports={handleInput:kr,makeAllStream:$r,getSpawnedResult:Br,validateInputSync:Lr}});var Yt=a((zs,Vt)=>{"use strict";var Mr=(async()=>{})().constructor.prototype,jr=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Mr,e)]),Fr=(e,t)=>{for(let[r,n]of jr){let s=typeof t=="function"?(...o)=>Reflect.apply(n.value,t(),o):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:s})}return e},Ur=e=>new Promise((t,r)=>{e.on("exit",(n,s)=>{t({exitCode:n,signal:s})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})});Vt.exports={mergePromise:Fr,getSpawnedPromise:Ur}});var Jt=a((Vs,Zt)=>{"use strict";var Qt=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Dr=/^[\w.-]+$/,Xr=/"/g,Hr=e=>typeof e!="string"||Dr.test(e)?e:`"${e.replace(Xr,'\\"')}"`,Kr=(e,t)=>Qt(e,t).join(" "),Wr=(e,t)=>Qt(e,t).map(r=>Hr(r)).join(" "),zr=/ +/g,Vr=e=>{let t=[];for(let r of e.trim().split(zr)){let n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t};Zt.exports={joinCommand:Kr,getEscapedCommand:Wr,parseCommand:Vr}});var cn=a((Ys,O)=>{"use strict";var Yr=require("path"),Se=require("child_process"),Qr=lt(),Zr=ft(),Jr=ht(),es=xt(),V=Gt(),tn=At(),{spawnedKill:ts,spawnedCancel:ns,setupTimeout:rs,validateTimeout:ss,setExitHandler:os}=Bt(),{handleInput:is,getSpawnedResult:cs,makeAllStream:as,validateInputSync:us}=zt(),{mergePromise:en,getSpawnedPromise:ls}=Yt(),{joinCommand:nn,parseCommand:rn,getEscapedCommand:sn}=Jt(),ds=1e3*1e3*100,fs=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:s})=>{let o=t?{...process.env,...e}:e;return r?Jr.env({env:o,cwd:n,execPath:s}):o},on=(e,t,r={})=>{let n=Qr._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:ds,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=fs(r),r.stdio=tn(r),process.platform==="win32"&&Yr.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},k=(e,t,r)=>typeof t!="string"&&!Buffer.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?Zr(t):t,Y=(e,t,r)=>{let n=on(e,t,r),s=nn(e,t),o=sn(e,t);ss(n.options);let i;try{i=Se.spawn(n.file,n.args,n.options)}catch(S){let y=new Se.ChildProcess,g=Promise.reject(V({error:S,stdout:"",stderr:"",all:"",command:s,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return en(y,g)}let c=ls(i),u=rs(i,n.options,c),l=os(i,n.options,u),f={isCanceled:!1};i.kill=ts.bind(null,i.kill.bind(i)),i.cancel=ns.bind(null,i,f);let m=es(async()=>{let[{error:S,exitCode:y,signal:g,timedOut:v},$,B,fn]=await cs(i,n.options,l),ye=k(n.options,$),ge=k(n.options,B),xe=k(n.options,fn);if(S||y!==0||g!==null){let be=V({error:S,exitCode:y,signal:g,stdout:ye,stderr:ge,all:xe,command:s,escapedCommand:o,parsed:n,timedOut:v,isCanceled:f.isCanceled,killed:i.killed});if(!n.options.reject)return be;throw be}return{command:s,escapedCommand:o,exitCode:0,stdout:ye,stderr:ge,all:xe,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return is(i,n.options.input),i.all=as(i,n.options),en(i,m)};O.exports=Y;O.exports.sync=(e,t,r)=>{let n=on(e,t,r),s=nn(e,t),o=sn(e,t);us(n.options);let i;try{i=Se.spawnSync(n.file,n.args,n.options)}catch(l){throw V({error:l,stdout:"",stderr:"",all:"",command:s,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let c=k(n.options,i.stdout,i.error),u=k(n.options,i.stderr,i.error);if(i.error||i.status!==0||i.signal!==null){let l=V({stdout:c,stderr:u,error:i.error,signal:i.signal,exitCode:i.status,command:s,escapedCommand:o,parsed:n,timedOut:i.error&&i.error.code==="ETIMEDOUT",isCanceled:!1,killed:i.signal!==null});if(!n.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}};O.exports.command=(e,t)=>{let[r,...n]=rn(e);return Y(r,n,t)};O.exports.commandSync=(e,t)=>{let[r,...n]=rn(e);return Y.sync(r,n,t)};O.exports.node=(e,t,r={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(r=t,t=[]);let n=tn.node(r),s=process.execArgv.filter(c=>!c.startsWith("--inspect")),{nodePath:o=process.execPath,nodeOptions:i=s}=r;return Y(o,[...i,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var ms={};gn(ms,{default:()=>ps});var dn=require("@raycast/api");var an=Ee(require("process"),1),un=Ee(cn(),1);async function ln(e){if(an.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await(0,un.default)("osascript",["-e",e]);return t}var ps=async()=>{await(0,dn.closeMainWindow)(),await ln(`tell application "Notes" to activate 
6: tell application "System Events" to tell process "Notes" to \xAC
7: click menu item "New Note" of menu 1 of \xAC
8: menu bar item "File" of menu bar 1`)};module.exports=xn(ms);0&&(module.exports={});
---

new.js:5:10330
processTicksAndRejections:task_queues:96:5
async ln:new.js:5:12075
async Object.ps:new.js:5:12173
async MessagePort.<anonymous>:index.js:1:2278
stale[bot] commented 2 years ago

This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean. Thanks for your contributions.