Setting picturedata by reference

38 views
Skip to first unread message

cmclane

unread,
Jun 20, 2018, 11:47:31 PM6/20/18
to SuperCard Discussion

I have not been able to set the picturedata of a draw rectangle graphic to a PNG image file by reference using what I think is a a correct path to the file. However, if I place the image file in the same folder as the SC project and use just the filename, not the full path, it works. What am I missing?


Supercard Help shows the example:

set the pictureData of bg grc “Holder” to reference file “Tree.pict” 


And says:

Only PICT files can be used with the reference keyword. Although other graphic formats (such as JPEG and GIF) can be used when embedding the source image directly in the object’s picture property, files in these formats cannot be used as referenced image files.


But in a recent post Mark said:

tt's probably also worth mentioning that . . . [setting the picturedata of a graphic] works MUCH better with pictureData set by reference (which nowadays supports any importable image format).


Can I set picturedata to a PNG file by reference? What is the best way to get the correct path? (I have tried the Get Info method and the drag the file to Terminal method with no success.) Do I need to set or reset file permissions somewhere?

codegreen

unread,
Jun 20, 2018, 11:49:50 PM6/20/18
to SuperCard Discussion
That bit about only PICT files is obsolete.

Are you using an HFS path, and is this in SC or SE?

-Mark

Mark Lucas

unread,
Jun 21, 2018, 12:19:35 AM6/21/18
to superca...@googlegroups.com
Here’s an update to the docs for this keyword:

Reference keyword SLG entry update

Mark Lucas

unread,
Jun 21, 2018, 12:29:21 AM6/21/18
to superca...@googlegroups.com
Say what?

That’s a plain text file (for some unknown reason with no extension).

Did it show up differently at your end?


> On Jun 21, 2018, at 12:19 AM, 'Mark Lucas' via SuperCard Discussion <superca...@googlegroups.com> wrote:
>
> Here’s an update to the docs for this keyword:
>
> --
> You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to supercard-tal...@googlegroups.com.
> To post to this group, send email to superca...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/1851C192-71E0-4DEB-BE1F-5C1129C8FDC6%40aol.com.
> For more options, visit https://groups.google.com/d/optout.
> <Reference keyword SLG entry update>

David Coggeshall

unread,
Jun 21, 2018, 12:33:34 AM6/21/18
to superca...@googlegroups.com
It comes up unformatted and un-wraped in BBEdit.

I'm just sayin'...

David Coggeshall


-----Original Message-----
From: 'Mark Lucas' via SuperCard Discussion <superca...@googlegroups.com>
To: supercard-talk <superca...@googlegroups.com>
Sent: Wed, Jun 20, 2018 9:29 pm
Subject: Re: [SuperCard Discussion] Re: Setting picturedata by reference

Say what?

That’s a plain text file (for some unknown reason with no extension).

Did it show up differently at your end?


> On Jun 21, 2018, at 12:19 AM, 'Mark Lucas' via SuperCard Discussion <supercard-ta...@googlegroups.com> wrote:
>
> Here’s an update to the docs for this keyword:
>
> --
> You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to supercard-talk+uns...@googlegroups.com.
> To post to this group, send email to supercard-ta...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/1851C192-71E0-4DEB-BE1F-5C1129C8FDC6%40aol.com.
> For more options, visit https://groups.google.com/d/optout.
> <Reference keyword SLG entry update>

--
You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supercard-talk+uns...@googlegroups.com.
To post to this group, send email to supercard-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/CAFC7988-AB16-4FAF-9536-D015231AEACA%40aol.com.

Mark Lucas

unread,
Jun 21, 2018, 12:37:14 AM6/21/18
to superca...@googlegroups.com
FWIW it ‘comes up’ as expected in TextEdit here.

One more reason (among many) I’m hatin’ the Google Groups UI…

Charles McLane

unread,
Jun 21, 2018, 10:56:00 AM6/21/18
to superca...@googlegroups.com
1. I believe I am using the newer POSIX path format. I found this in a quick internet search:

Converting between formats
Assuming oldPath would be an alias or record of a finder item, use the following command to set a standard Applescript alias to a POSIX path:

 set thisPOSIXPath to (the POSIX path of oldPath)
 -- input: "Macintosh HD:Applications:Safari.app"
 -- output: "/Applications/Safari.app"

My path looks like the POSIX path, and that answers one of my questions because when I drop the file onto the Terminal the resulting path does NOT include "Macintosh HD:" which is apparently fine under the new format.

2. I am building the project (i.e. setting up the single card with a draw graphic rectangle object) in SE and then selecting Run which kicks me to SC. The script in the one button on the card that looks in the folder for the graphic loads it. The script in the other button on the card that looks to the desktop doesn't. (In fact there is not response, no error message, no nothing.)



--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/al5t-Lln7Ts/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/dd9242bb-a768-4f9d-afb4-ee457ff94fce%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Charles F. McLane III, PhD
Principal

707 Alexander Road, Suite 206 - Princeton NJ 08540
Direct: 609-919-2701  Fax: 609-987-8488

Charles McLane

unread,
Jun 21, 2018, 10:56:49 AM6/21/18
to superca...@googlegroups.com
It showed up here as a plain text file with no extension. But I can read it OK in TextEdit.

On Thu, Jun 21, 2018 at 12:29 AM, 'Mark Lucas' via SuperCard Discussion <superca...@googlegroups.com> wrote:
Say what?

That’s a plain text file (for some unknown reason with no extension).

Did it show up differently at your end?


> On Jun 21, 2018, at 12:19 AM, 'Mark Lucas' via SuperCard Discussion <supercard-talk@googlegroups.com> wrote:
>
> Here’s an update to the docs for this keyword:
>
> --
> You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to supercard-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to supercard-talk@googlegroups.com.
> <Reference keyword SLG entry update>

--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/al5t-Lln7Ts/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

codegreen

unread,
Jun 21, 2018, 3:06:57 PM6/21/18
to SuperCard Discussion
On Thursday, June 21, 2018 at 10:56:00 AM UTC-4, cmclane wrote:
1. I believe I am using the newer POSIX path format. I found this in a quick internet search:

 For backwad compatibility SC still uses (and expects) HFS paths.

If you have a POSIX path, you can use posixToHFS() to convert it to HFS format.

-Mark

Charles McLane

unread,
Jun 21, 2018, 3:20:13 PM6/21/18
to superca...@googlegroups.com
That did it. Thanks Mark!

--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/al5t-Lln7Ts/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages