Search found 497 matches
- 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...
- Mon Aug 30, 2021 1:37 pm
- Forum: SheepShaver
- Topic: Copying pictures
- Replies: 115
- Views: 19573
Re: Copying pictures
If you run
in AppleScript (substitute PATH_TO_SOME_IMAGE), does that make a preview appear?
Code: Select all
do shell script "/usr/bin/qlmanage -p PATH_TO_SOME_IMAGE > /dev/null 2>&1 &"
- 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.
- 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...
- 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...
- 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...
- 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...
- 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...
- 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.
- 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...
- 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!
- 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...
- 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...
- 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 ...
- 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...
- 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...
- 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...
- 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...
- 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...
- Wed Aug 25, 2021 8:38 pm
- Forum: SheepShaver
- Topic: Copying pictures
- Replies: 115
- Views: 19573
- 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...
- 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 followed by – what is the output then?
After copying in SheepShaver, If you run
Code: Select all
set the clipboard to (the clipboard as «class PNGf»)
Code: Select all
return clipboard info
- 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 after copying the image in SheepShaver?
Code: Select all
return clipboard info
- 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», ...
- 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...