[GH-ISSUE #1809] Cant write a file with writeToFile function using scripting #1803

Open
opened 2026-03-03 19:54:31 +03:00 by kerem · 4 comments
Owner

Originally created by @Shiro-umi on GitHub (Oct 16, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1809

Description

Steps to Reproduce

async function onResponse(context, url, request, response) {
      writeToFile("~/proxyman_output/data", response.body);
      return response;
}

Current Behavior

Although Full Disk Access is granted, an read-only file system error occurred.

Error: Export func: Error Domain=NSCocoaErrorDomain Code=642 "You can’t save the file “[object Object]” because the volume “Macintosh HD” is read only." UserInfo={NSFilePath=/[object Object], NSUserStringVariant=Folder, NSUnderlyingError=0x6000019d9fe0 {Error Domain=NSPOSIXErrorDomain Code=30 "Read-only file system"}}

Expected Behavior

Environment

  • App version: e.g Proxyman 4.12.0
  • macOS version: e.g macOS Sonoma
Originally created by @Shiro-umi on GitHub (Oct 16, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1809 ## Description <!--- Description for the bug? --> ## Steps to Reproduce <!-- Add relevant code and/or a live example --> ```javascript async function onResponse(context, url, request, response) { writeToFile("~/proxyman_output/data", response.body); return response; } ``` ## Current Behavior <!--- What went wrong? --> Although Full Disk Access is granted, an read-only file system error occurred. >Error: Export func: Error Domain=NSCocoaErrorDomain Code=642 "You can’t save the file “[object Object]” because the volume “Macintosh HD” is read only." UserInfo={NSFilePath=/[object Object], NSUserStringVariant=Folder, NSUnderlyingError=0x6000019d9fe0 {Error Domain=NSPOSIXErrorDomain Code=30 "Read-only file system"}} ## Expected Behavior <!--- What should have happened? --> ## Environment - App version: e.g Proxyman 4.12.0 - macOS version: e.g macOS Sonoma
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 16, 2023):

@Shiro-umi can you try to write to your Desktop, such as ~/Desktop/file.data ?

<!-- gh-comment-id:1763793735 --> @NghiaTranUIT commented on GitHub (Oct 16, 2023): @Shiro-umi can you try to write to your Desktop, such as `~/Desktop/file.data` ?
Author
Owner

@Shiro-umi commented on GitHub (Oct 16, 2023):

@Shiro-umi can you try to write to your Desktop, such as ~/Desktop/file.data ?

I tried this:

  writeToFile("~/Desktop/file.data", response.body);
  writeToFile("~/Desktop/[filename]", response.body);

but still not working, same error reported.

<!-- gh-comment-id:1763805224 --> @Shiro-umi commented on GitHub (Oct 16, 2023): > @Shiro-umi can you try to write to your Desktop, such as `~/Desktop/file.data` ? I tried this: ```javascript writeToFile("~/Desktop/file.data", response.body); writeToFile("~/Desktop/[filename]", response.body); ``` but still not working, same error reported.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 16, 2023):

You might check this permission in the System Setting -> Privacy -> Files and Folder -> Turn on the Desktop or any folders there. Proxyman doesn't need the Full Disk Access.

CleanShot 2023-10-16 at 13 23 36@2x

<!-- gh-comment-id:1763807958 --> @NghiaTranUIT commented on GitHub (Oct 16, 2023): You might check this permission in the System Setting -> Privacy -> Files and Folder -> Turn on the Desktop or any folders there. Proxyman doesn't need the Full Disk Access. ![CleanShot 2023-10-16 at 13 23 36@2x](https://github.com/ProxymanApp/Proxyman/assets/5878421/08179930-7393-4ae4-a307-94e08a5f5ff1)
Author
Owner

@Shiro-umi commented on GitHub (Oct 16, 2023):

You might check this permission in the System Setting -> Privacy -> Files and Folder -> Turn on the Desktop or any folders there. Proxyman doesn't need the Full Disk Access.

CleanShot 2023-10-16 at 13 23 36@2x

I can't find Proxyman in the list if I turn off the Full Disk Access, and there is no "+" button to modify it manually.

<!-- gh-comment-id:1763816130 --> @Shiro-umi commented on GitHub (Oct 16, 2023): > You might check this permission in the System Setting -> Privacy -> Files and Folder -> Turn on the Desktop or any folders there. Proxyman doesn't need the Full Disk Access. > > ![CleanShot 2023-10-16 at 13 23 36@2x](https://user-images.githubusercontent.com/5878421/275409928-08179930-7393-4ae4-a307-94e08a5f5ff1.jpg) I can't find Proxyman in the list if I turn off the Full Disk Access, and there is no "+" button to modify it manually.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1803
No description provided.