Jump to content

Recommended Posts

I have that set, but it still copies to my clipboard

Are you saying it does not copy as SVG formatted text or something else?

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

I still don't understand what you mean. The clipboard is not a file in the normal sense. It is a temporary storage location the OS can use to pass data between apps & apps can use internally for their own temporary data storage. Its contents are not saved to the file system if the computer is shut down.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

From your conversation I got the idea, that "copy as SVG"-(text) means that I could paste it to a text editor afterwards and edit it there. For small objects that would be rather useful, but that does not seem to work. Thus my unanswered question from above stands: what difference is that setting supposed to make? 

Link to post
Share on other sites

From your conversation I got the idea, that "copy as SVG"-(text) means that I could paste it to a text editor afterwards and edit it there. For small objects that would be rather useful, but that does not seem to work. Thus my unanswered question from above stands: what difference is that setting supposed to make? 

You're correct.

I copy a path in AD, and it is saved to my clipboard as this

yFoRStPI5e.png

/var/folders/d8/45mcrkq12mg772hdtjhcsyd00000gr/T/com.seriflabs.affinitydesigner/Clipboard.svg

Path to a file, I open that file, and it's the svg I copied.

If I paste it in Finder, it is saved as Clipboard.svg AYusIFnDK9.png

Link to post
Share on other sites

All I know for sure is that on a Mac, checking the "Copy Items as SVG" box puts SVG-related data on the clipboard formatted as an XML text object (not a file) with a "<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">"declaration & formats the SVG data according to the markup tags defined by that DTD (document type definition) standard. 

 

That makes it available to other apps but they must be able to parse XML to use it, & there is no guarantee they will interpret or use the tagged data in exactly the same way, if at all.

 

Also, if the copied item has no graphic content, then the clipboard will contain only data relevant to that. For instance, if the copied object is the text in a Frame or Art text object, the clipboard will contain only styled text in the RTF format. Most apps understand RTF, but ones that don't may extract only the plain (un-styled) text content, or nothing at all if they don't support text.

 

On a Mac, you can see what is on the clipboard by going to Finder & choosing "Show Clipboard" from the Edit menu. You can also paste it into another app, but that app must be able to interpret the data as text if you want to see it as such.

 

I assume all this is equally relevant for Windows but you will have to ask others for specific info about that because I do not use Windows PCs. Regardless, I hope you now see that the clipboard is not as simple or straightforward as you might have thought, that "under the hood" there is a lot going on to make it capable of passing data between apps.

 

EDIT: I had not seen your last post when I wrote the above. One thing to note about what you discovered is that /var/ is a temporary storage location for variables (thus the name) & its contents will be cleared whenever the Mac is restarted & for some things possibly at other times, like when an app quits.

Edited by R C-R

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

That does not work in the / my Windows-version. If I copy a vector object with the "copy as svg" setting on, there seems to be nothing in the clipboard. Neither can I paste it as a file, nor to a texteditor. 

But I can paste the object to an Affinity app as vector again. Pasting it to some other grafic app, it pastes as a pixel img. 

 

Also, there is no file "clipboard.svg" in the filesystem anywhere to be found. 

 

So sth. is wrong there... 

Link to post
Share on other sites

But I can paste the object to an Affinity app as vector again. Pasting it to some other grafic app, it pastes as a pixel img. 

Mac or Windows, that is how the clipboard should work. All Affinity or any other app can do is put data on the clipboard in one or more formats, but it is up to the other apps to decide if or how they can use that data.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

So far so clear - but what about pasting to a pure texteditor - should that not reveal the svg-xml as text? 

That depends entirely on the text editor app. Many will paste the raw text into a text document, but some may be coded to ignore XML or try to interpret it in some way that doesn't make sense, possibly even in a way that might crash the app. Other text editing apps may be quite capable of displaying SVG content, either by converting it to a flattened raster object or as one or more vector objects, & they may have preferences or other settings to control that.

 

It may help to remember that the Affinity preference refers to "items," which could be anything from a single vector object to a flattened raster image, or a combination of several layers of different types, or even something with no graphic representation. Since the SVG format can include vector, raster, & text graphic objects (not to mention scripting & animation that Affinity does not support), there are many different ways these items can be formatted & interpreted when passed between different apps.

 

I am just guessing but I think that is why the Affinity option to copy as SVG exists & is not the default -- without it on, from what I can tell the only things that get copied to the clipboard that are available externally to other apps are simple text objects like the contents of a Frame Text object or a text field value like a number or layer name. There are very few apps that can't use or at least handle text objects without issues, making that option the safest, most worry free default choice.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

I do not expect the SVG to show up as an image in the texteditor, but as the pure xml text it basically is. 

 

To be clear about what I mean: I use svg in webdesign, sometimes placing the svg als external img-file, sometimes by placing the XML as text right into the HTML. I can take any svg and open it in my texteditor in order to change the xml. For use in webdesign the more complex files (like Inkscape SVG) need to be simplified to the mere color, path and bounding box information. 

 

If I could design or change a simple object in Designer and just paste the xml as text, that would make this process easier. If that is not what the setting is meant for, I just need to export the object as svg and then open it in the texteditor, which will always work. 

Link to post
Share on other sites

Like I said, what shows up in the text editing app depends on how it is coded.

 

On a Mac, the included TextEdit app displays the raw XML, as do some third party apps I own like TextWranger. But a full blown word processor like Nisus Writer Pro refuses to do that, showing only a link which actually points to the temp file in the var folder if I do a normal paste, & hangs the app if I try to do a "text only" paste, which is one of the options that app provides. On the other hand, the included Preview app has a "new from clipboard" option & that converts the SVG XML to a flattened PDF document.

 

I am sure there must be text editing apps for Windows that will display the raw XML text without problems, probably more than for Macs. I don't know what they might be, but I hope one of the other forum contributors can help you with that.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites
  • 3 months later...
  • 4 months later...

I am having this same issue. I'm using a Mac and I've changed the settings to 'Copy items as svg'. When I copy an item in Affinity Designer, it copies a temporary svg file to the clipboard. When I copy an item in Sketch, it copies the xml code to the clipboard.

Link to post
Share on other sites
  • 7 months later...
  • 1 year later...

I'm running MacOS High Sierra and Affinity Designer 1.7.3 and I can tell you that regardless of that "Copy items as SVG" preference setting, the text/code of the SVG (which is what I want) is NOT copied to the clipboard.  And yes, I confirm that in the Finder via Show Clipboard.  I cannot paste the code of my copied SVG into TextWangler, TextEdit, Sublime or any other text editor.  If I try to paste into an Outlook email, I get the SVG graphic pasted, not the code of the SVG.  I want to copy the CODE!

To repeat, I want to click an SVG in Affinity Designer on my High Sierra Mac and copy only the CODE of the SVG such that I can paste that code anywhere as raw text so I can edit that text as I see fit. That's not possible now, with or without that preference setting ticked.  And just to let everyone know, I am dragging the individual icons from this asset pack to the page in Affinity Designer and then doing the Copy.

Please advise.

Link to post
Share on other sites
2 hours ago, JDW said:

I'm running MacOS High Sierra and Affinity Designer 1.7.3 and I can tell you that regardless of that "Copy items as SVG" preference setting, the text/code of the SVG (which is what I want) is NOT copied to the clipboard.  And yes, I confirm that in the Finder via Show Clipboard.

I am running Mojave now but when I was running High Sierra with "Copy items as SVG" enabled, the SVG text definitely was copied to the clipboard. I verified this in several ways, one of which was to use Clipboard Viewer.app, an old developer tool capable of showing everything on the clipboard & how it is formatted. Finder's Edit > Show Clipboard is not a good test for this because it does not necessarily show everything on the clipboard.

Unfortunately, Clipboard Viewer.app is no longer available from Apple, but to get an idea of what it does, see the second answer at https://superuser.com/questions/541335/clipboard-viewer-for-os-x-that-allows-extracting-the-data-in-any-available-forma (7 years ago).

EDIT: I just retested this in Mojave. Both Finder's Edit > Show Clipboard & Clipboard Viewer.app show the svg text being copied to the clipboard. I had no problems copying it as text into TextEdit or BBEdit (the replacement for TextWrangler). 

It begins with a standard xml header & DOCTYPE declaration, like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

I am not sure why you are not getting similar results.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites
1 hour ago, R C-R said:

I am not sure why you are not getting similar results.

At the end of the day, that may be the only conclusion (and what a very sad conclusion it is), but to satisfy you I just downloaded Clipboard Viewer from Apple and compiled it within Xcode 10.1 (I had to suppress warnings to make compile work because it's a 32-bit app), and then launched it alongside Affinity Designer 1.7.3.  I then opened a new document in Designer, dragged the YouTube icon to the page (from the Font Awesome assets in my left sidebar), and with the icon on the page selected, I clicked the Edit menu and chose "Copy."  I then switched to Clipboard Viewer, clicked Reload, and I could then see com.seriflabs.persona.nodes at left, and when I clicked that, Clipboard Viewer showed me only the path as follows ("General Clipboard" selected in popup, content=81 bytes):

/Users/myusername/Library/Group Containers/6LVTQB9699.com.seriflabs/clipboard/5e2fb6fb

That proves the CODE of the SVG is NOT being copied.  (There is a popup menu item named "Drag Clipboard" which shows com.seriflabs.AssetItem at left, but there is no content.)

I then switched back to Designer, and unticked "Copy items as SVG" (disabling it), and then I repeated the copy.  Clipboard Viewer shows the following:

/Users/myusername/Library/Group Containers/6LVTQB9699.com.seriflabs/clipboard/5e2fb86f

And there you have it.

Link to post
Share on other sites

I just tried again with this very simple SVG test.afdesign file. It has just a single "Normal" button group from the Grade UI assets with 1 rounded rectangle & one art text object.

Clipboard Viewer.app shows 11 types in the general clipboard, the first of which is com.seriflabs.persona.nodes. However, two of the others (NSFilnamesPBoardType & a long one beginning with dyn) show the xml stuff, as below:

1766679928_SVGtestclipboardviewer.jpg.f9f58ce28fe381c9315d4c4a831a73be.jpg

I have also tested with much more complex, multilayer groups (to around 1.2 MB of Pboard data or more) & with single vector objects copied to the clipboard. 

In all tests, the full text (beginning with "<?xml" as above) pastes without issues into a new plain text TextEdit document & into a new BBEdit document using the File > New > Text Document > (with Clipboard) option. To the best of memory this is the same behavior I got with High Sierra & (I think) Sierra before it.

The only thing I can suggest is you may need to reset something in AD to factory defaults to get this to work but I am not sure what that would be.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

I get that too in Clipboard Viewer, but that is only an XML PLIST which contains a path to Clipboard.svg:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <string>/var/folders/0y/cng7v78s4x15w25qqbkd2yh80000gp/T/com.seriflabs.affinitydesigner/Clipboard.svg</string>
</array>
</plist>

Next I will no doubt hear: "just dig down into that path and open the svg and then you have the code." But I honestly don't want to do that with many different SVGs.  I want to be able to copy the code of the SVG within Affinity Designer, not copy a PLIST containing a path -- a PLIST that is only accessible via Clipboard Viewer which won't work under Catalina at all.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.