I've created a script and bound it to an icon, then added the icon to the standard toolbar.
Everything works, but the script will (correctly) give an error message if it's run when no image is open.
The bound icon on the toolbar is always enabled, even if no image is open. Is there a way to have the icon disabled (grayed out) if no image is open?
Script question: Disable bound icon if no image is open
Moderator: Kathy_9
-
photodrawken
- Posts: 684
- Joined: Wed Sep 26, 2012 8:40 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 16Gb
- Hard_Drive_Capacity: 324Gb
- Location: USA
Script question: Disable bound icon if no image is open
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
-
Cassel
- Posts: 1587
- Joined: Fri Oct 29, 2010 6:49 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 16Gb
- Corel programs: PSP 8 (JASC) to PSP 2023
- Location: Canada
- Contact:
Re: Script question: Disable bound icon if no image is open
I am not aware of such feature, but if it is possible, i sure would LOVE to find out too!
Cassel
https://creationcassel.com/store
Specializing in PSP specific products: scripts and tubes
https://scrapbookcampus.com
for beginner and seasoned scrappers and designers and other PSP users
https://creationcassel.com/store
Specializing in PSP specific products: scripts and tubes
https://scrapbookcampus.com
for beginner and seasoned scrappers and designers and other PSP users
-
LeviFiction
- Advisor
- Posts: 6831
- Joined: Thu Oct 02, 2008 1:07 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Alienware M17xR4
- processor: Intel Core i7-3630QM CPU - 2_40GH
- ram: 6 GB
- Video Card: NVIDIA GeForce GTX 660M
- sound_card: Sound Blaster Recon3Di
- Hard_Drive_Capacity: 500GB
- Corel programs: PSP: 8-2023
- Location: USA
Re: Script question: Disable bound icon if no image is open
No there isn't. They don't even have a command for checking for an image built into the language API. They originally made the PSPUtils script library to make up for things like that.
You know, of all of the things we asked for for scripting. Maybe this should be considered in the future. Make it part of the script properties 'RequiresDocument': 1 as well as other things like 'RequiresSelection', or 'Requiresvector' and so on. Really make it decently conditional. Even though most would only use the first one.
Time to bring this up at the other forum.
You know, of all of the things we asked for for scripting. Maybe this should be considered in the future. Make it part of the script properties 'RequiresDocument': 1 as well as other things like 'RequiresSelection', or 'Requiresvector' and so on. Really make it decently conditional. Even though most would only use the first one.
Time to bring this up at the other forum.
https://levifiction.wordpress.com/
-
photodrawken
- Posts: 684
- Joined: Wed Sep 26, 2012 8:40 am
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 16Gb
- Hard_Drive_Capacity: 324Gb
- Location: USA
Re: Script question: Disable bound icon if no image is open
Ahh, too bad. Thanks for the info.LeviFiction wrote:No there isn't.
Yes, I noticed theLeviFiction wrote:They don't even have a command for checking for an image built into the language API. They originally made the PSPUtils script library to make up for things like that.
Code: Select all
def Do(Environment):
if PSPUtils.RequireADoc( Environment ) == App.Constants.Boolean.false:
returnYes. For Photoshop Elements, Adobe uses a single line of commented code at the beginning of the script to tell the program whether or not to enable the script, depending on if a document needs to be opened or not. It's a pretty smooth system....LeviFiction wrote:You know, of all of the things we asked for for scripting. Maybe this should be considered in the future. Make it part of the script properties 'RequiresDocument': 1 as well as other things like 'RequiresSelection', or 'Requiresvector' and so on. Really make it decently conditional. Even though most would only use the first one.
PSP has a distance of several light years to travel before it gets the good scripting capabilities offered by Adobe (with their Extend Script Toolkit), or even CorelDraw with its use of the VSTA editor (for .Net scripting). In each case, the object model has been exposed -- via an XML file in the case of Adobe, and via a .Net framework object model in the case of CorelDraw. Either way, it makes accessing the program's functions much more useful.
What forum is that?LeviFiction wrote:Time to bring this up at the other forum.
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
-
LeviFiction
- Advisor
- Posts: 6831
- Joined: Thu Oct 02, 2008 1:07 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Alienware M17xR4
- processor: Intel Core i7-3630QM CPU - 2_40GH
- ram: 6 GB
- Video Card: NVIDIA GeForce GTX 660M
- sound_card: Sound Blaster Recon3Di
- Hard_Drive_Capacity: 500GB
- Corel programs: PSP: 8-2023
- Location: USA
Re: Script question: Disable bound icon if no image is open
Well, you can give a more detailed message box instead of only using return. Not that there's any real point in doing so.
I can't speak to Adobe or CorelDraw but accessing PSP's functions via object could easily be accomplished. We would just need someone to take the time to make that object library. Still waiting on Corel to update the scripting documentation though. And they really need to work on adding more functionality options. They've long let the options remain un-improved.
The CorelYourWay forum.
I can't speak to Adobe or CorelDraw but accessing PSP's functions via object could easily be accomplished. We would just need someone to take the time to make that object library. Still waiting on Corel to update the scripting documentation though. And they really need to work on adding more functionality options. They've long let the options remain un-improved.
The CorelYourWay forum.
https://levifiction.wordpress.com/
