sketch-devtools
sketch-devtools copied to clipboard
print/log methods are not being vandalized correctly in a rare case
Bug report from German Bauer:
Andrey, to be more precise here is what happens:
- I add your plugin folder with the great dev tools
- I go back to sketch and see the newly added console commands under plugins > your folder
- I bring up your dev console
- The above described bug shows up, not with my plugin, but with your 3 line sample code
- The above described bug shows up, even with just one "print(sketch)" line in the custom plugin field from your sample code
- I remove all other plugins from the plugins folder, same bug
- I remove your plugin from plugins folder it all starts working again as expected
The screenshot:
Experiment 1:
Run the following code using custom script editor:
SketchConsole.extendedPrint_info_sourceScript(sketch,{
line: 1
},coscript.printController().processedScript());
I need to know if it produces any output into DevTools console. Also it would be nice to have a screenshot of the result.
Experiment 2:
- Launch system Console App (/Applications/Utilities/Console.app)
- Add new system log query using File -> New System Log Query...
- In the query set
sender
containssketch
: - Select the newly created query:
- Clear console.
- Run only once the following script in the custom script editor:
print(sketch);
Finally - publish console output in the comment.
Questions:
- Did you compile the SketchConsole.framework yourself or just downloded the
Sketch DevTools.zip
archive and extracted it intoPlugins
folder? - Do you use Sketch from AppStore or it is non-sandboxed version that was downloaded from BC site and bought using third-party merchant store?
- What version of Sketch do you use?
- What OSX version do you use?
Experiment 3:
- Clear system console output.
- Run the following code in the custom script editor:
coscript.print(print);
coscript.print(log);
Copy and paste output as a comment here.
Could this somehow be related to zmalltalker/sketch-android-assets#22 ?
Oh yeah! It's definitely related. Thanks for reporting it. I'm trying to track this bug since the first release day, but can't replicate it. Will ask mmrocks to participate.
Hi - I installed devtools and ran into the same problem. I'll try to answer the questions: Experiment 1- This appears in the console: { doc = "<MSDocument: 0x6000003ed200>"; scriptPath = "/Users/woody/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin"; scriptURL = "file:///Users/woody/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application%20Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin"; selection = ( ); }
Experiment 2: in the system console I get: 1/16/15 2:01:28.875 PM Untitled (Sketch Plugin)[26438]: TypeError: 'undefined' is not a function (evaluating 'print(sketch)'). Plugin “Untitled”, line 1. » print(sketch); « 1/16/15 2:01:28.875 PM Sketch[26438]: Exception: { line = 1; sourceURL = "/Users/woody/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin"; stack = "global code@/Users/woody/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin:1:6"; }
Experiment 3- In the system console I get: 1/16/15 2:06:34.097 PM Untitled (Sketch Plugin)[26438]: <MOUndefined: 0x60000001b170> 1/16/15 2:06:34.097 PM Untitled (Sketch Plugin)[26438]: <MOUndefined: 0x60000001b170>
I'm using OSX 10.9.5, Sketch 3.2.2 ( from the App Store, so sandboxed),and I downloaded the zip and extracted it into the plugins folder.
Hope this helps
I ran into this bug too. Here's the info:
System:
- OSX 10.9.5
- Sketch 3.3 from the App Store
- Sketch DevTools master downloaded and copied to plugin directory
Experiment 1:
ReferenceError: Can't find variable: sketch stack: onRun@/Users/dproct01/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin:2:55 line: 2 sourceURL: /Users/dproct01/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin
Experiment 2:
23/04/2015 14:07:37.356 Sketch[13966]: Exception: ReferenceError: Can't find variable: sketch 23/04/2015 14:07:37.356 untitled script (Sketch Plugin)[13966]: ReferenceError: Can't find variable: sketch stack: onRun@/Users/dproct01/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin:2:15 line: 2 sourceURL: /Users/dproct01/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin
Experiment 3:
23/04/2015 14:08:21.400 untitled script (Sketch Plugin)[13966]: <MOUndefined: 0x618000006930> 23/04/2015 14:08:21.400 untitled script (Sketch Plugin)[13966]: <MOUndefined: 0x618000006930>