Search found 497 matches

by mabam
Mon Aug 30, 2021 3:10 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

It had possibly something to do with access to the Documents folder. The latest script did not ask to allow access to the Documents folder. Access was checked in System Preferences > Security & Privacy > Files and Folders, possibly because an earlier version did ask for it. I checked and checke...
by mabam
Mon Aug 30, 2021 1:37 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

If you run

Code: Select all

do shell script "/usr/bin/qlmanage -p PATH_TO_SOME_IMAGE > /dev/null 2>&1 &"
in AppleScript (substitute PATH_TO_SOME_IMAGE), does that make a preview appear?
by mabam
Mon Aug 30, 2021 11:36 am
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

That’s exactly what I did. Then, after copying a PICT image from SheepShaver, I ran the app and the preview was displayed.
by mabam
Mon Aug 30, 2021 8:30 am
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Thank you for the new version! The conversion still works fine but I can’t make the preview work by renaming the app. Not permanently (“Show”) and not via the option key (“Key”/“Option”). It does work if changing “property showImage : false” to “true” in the script, though. Some years ago I had sear...
by mabam
Sun Aug 29, 2021 8:41 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I have found two solutions. The first one is a shell one liner found on https://www.cyberciti.biz/faq/linux-run-a-command-with-a-time-limit/ : do shell script "doalarm() { perl -e 'alarm shift; exec @ARGV' -- \"$@\"; }; doalarm 5 /usr/bin/qlmanage -p ~/Documents/clipboardConvFile.&quo...
by mabam
Sun Aug 29, 2021 3:44 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I’ve found a solution on stackoverflow.com : Add “ > /dev/null 2>&1 & echo $!” to the shell command. This also returns the PID of the process which we don’t need when using its name to quit it from AppleScript. So the following should work: do shell script "/usr/bin/qlmanage -p ~/Docume...
by mabam
Sun Aug 29, 2021 1:24 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

You've made it easier for other people to find related information. That was part of my intention. The other part was ordering and documenting it for myself. It would be very good to have a preview app that could display the contents of the clipboard from AppleScript or the command line, but it doe...
by mabam
Sat Aug 28, 2021 8:25 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Here my amendments to the script: First off, AppleScript prepends four letters for the data descriptor type to the hex values in «data …». So for the pictHeader I’ve set those to “PICT”. I doubt it matters in this case, but just to make the code as clean as possible. . I’ve now added some lines to t...
by mabam
Sat Aug 28, 2021 6:34 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I actually like your idea of amending the app’s file name in order to activate/deactivate things. ’Cause I think for the average user that’s way easier than changing something in the code.
by mabam
Sat Aug 28, 2021 5:14 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

EDIT: Now that I think about it, it would be easy to add a few lines to the code that would show the preview if you hold down the Option key when launching the script. But if one wants to run the script with an assigned shortcut containing the option key, wouldn’t that interfere? Maybe you could im...
by mabam
Sat Aug 28, 2021 12:17 am
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Thank you for updating the binary, works fine!
by mabam
Fri Aug 27, 2021 10:42 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

emendelson, great work! I couldn’t have produced that base script in the time you did. And I have only learned AppleScript by trial and error myself. So you provide pieces of script in a convenient way I wouldn’t have thought of myself. I have amended the clipboard test so the script only runs if PI...
by mabam
Fri Aug 27, 2021 10:59 am
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

This looks very interesting. I've lost track of details. Do you have a way to get the non-working PICT data from the host clipboard to a file? This will get any PICT data from the clipboard to a file including a 512-byte header: EDIT: Just for reference – this AppleScript will create a PICT file fr...
by mabam
Fri Aug 27, 2021 12:19 am
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I just found Deark: https://github.com/jsummers/deark From the non-working PICT file it would extract a QTIF file and from that, in a second run, a JPEG file. This should also work for other image formats. It can probably be automated together with a script that copies the now readable image format ...
by mabam
Thu Aug 26, 2021 7:06 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

One possibility is this: there are two kinds of PICT file, I think. The ones created by QuickTime have a larger bit depth than the ones created by GraphicConverter or the ones created when you save the desktop to the clipboard in SheepShaver. They have different creator types. SimpleText can't disp...
by mabam
Thu Aug 26, 2021 6:57 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Yes, I’m running 9.0.4. For some reason the PICT in the clipboard doesn’t contain a header. If I save as PICT from GraphicConverter in SheepShaver, the header is just null data up to offset 522. But no matter whether I use that image or prepend the header manually to what I have saved from the clipb...
by mabam
Thu Aug 26, 2021 2:37 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I ran into the same issue now: The image is white while its size correspondents with what was copied in SheepShaver. a) What I did before (when it still worked): I used an image that was previously saved as PICT by GraphicConverter in SheepShaver, opened it with PictureViewer (part of QuickTime) and...
by mabam
Thu Aug 26, 2021 12:34 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

An interesting fact that I did not mention before: The blank (white) image that is opened in Preview or Graphic Converter using 'open new image from clipboard' has the same size in pixels as the image that was copied in SheepShaver. Together with your file size discrepancies I noticed at https://ww...
by mabam
Wed Aug 25, 2021 11:26 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Good to hear it works for you under Big Sur. You don’t actually need the line “the clipboard as TIFF picture”. If the clipboard does not contain an image, setting the clipboard to the PNG will fail and the script snippet does nothing as it is in a try block. So it will have the same effect as with t...
by mabam
Wed Aug 25, 2021 8:38 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Then I think this would be the next step to verify:
mabam wrote: Wed Aug 25, 2021 8:06 pm Maybe others on Catalina or Big Sur could test this to see whether it is indeed related to the host OS version?
by mabam
Wed Aug 25, 2021 8:06 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Now «class PNGf» is at first position. If pasting doesn’t work at this point that might mean something changed with Big Sur. If I proceed this way on Catalina pasting works fine, also when choosing “Open new image from clipboard” in Preview. (But directly pasting as PICT after copying from SheepShav...
by mabam
Wed Aug 25, 2021 7:12 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

Your output contains «class PNGf». That means the clipboard contains a PNG version of the image at a subsequent position.

After copying in SheepShaver, If you run

Code: Select all

set the clipboard to (the clipboard as «class PNGf»)
followed by

Code: Select all

return clipboard info
– what is the output then?
by mabam
Wed Aug 25, 2021 5:45 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

What’s the output of Script Editor if you run

Code: Select all

return clipboard info
after copying the image in SheepShaver?
by mabam
Wed Aug 25, 2021 2:42 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I’ve found https://mybyways.com/blog/applescript-to-change-clipboard-image-format which explains a very easy way to accomplish the image conversion: By running return clipboard info in AppleScript after copying an image in SheepShaver, the result is something like {{picture, 196092}, {«class 8BPS», ...
by mabam
Tue Aug 24, 2021 11:54 pm
Forum: SheepShaver
Topic: Copying pictures
Replies: 115
Views: 19573

Re: Copying pictures

I wanted to compare the file’s content with the clipboard one’s to find out what needs to be parsed and how. But looking at the content you posted this is too complicated for me when not sitting behind a Mac. So this has to wait at least until next week. I’ve looked further into this. The following...