diff --git a/scribus/plugins/scriptplugin/cmdobj.cpp b/scribus/plugins/scriptplugin/cmdobj.cpp
index 04534b865..e3a96a89f 100644
--- a/scribus/plugins/scriptplugin/cmdobj.cpp
+++ b/scribus/plugins/scriptplugin/cmdobj.cpp
@@ -641,63 +641,36 @@ PyObject *scribus_setstyle(PyObject* /* self */, PyObject* args)
 		return nullptr;
 	}
 
-	// First, find the style number associated with the requested style
-	// by scanning through the styles looking for the name. If
-	// we can't find it, raise PyExc_Exception.
-	// FIXME: Should use a more specific exception.
-	bool found = false;
-	QString paraStyleName = QString::fromUtf8(style);
-	// We start at zero here because it's OK to match an internal name
+	QString styleName = QString::fromUtf8(style);
+	QString itemName = QString::fromUtf8(name);
+
 	ScribusDoc*  currentDoc = ScCore->primaryMainWindow()->doc;
 	ScribusView* currentView = ScCore->primaryMainWindow()->view;
-	ScribusMainWindow* currentWin = ScCore->primaryMainWindow();
-	const StyleSet<ParagraphStyle> &docParagraphStyles = currentDoc->paragraphStyles();
-	int docParagraphStylesCount = docParagraphStyles.count();
-	for (int i=0; i < docParagraphStylesCount; ++i)
+
+	if (!currentDoc->paragraphStyles().contains(styleName))
 	{
-		if (docParagraphStyles[i].name() == paraStyleName) {
-			found = true;
-			break;
-		}
-	}
-	if (!found) {
-		// whoops, the user specified an invalid style, complain loudly.
 		PyErr_SetString(NotFoundError, QObject::tr("Style not found.","python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-	// for current item only
-	if (currentDoc->m_Selection->isEmpty() || (strlen(name) > 0))
+
+	int mode{modeNormal};
+	bool isCurrentItem = itemName.isEmpty() || itemName == currentDoc->m_Selection->itemAt(0)->itemName();
+
+	if (!isCurrentItem)
 	{
-		// Store text selection as clearing object selection
-		// will also clear text selection
-		int selectionStart = -1;
-		int selectionLength = item->itemText.selectionLength();
-		if (selectionLength > 0)
-			selectionStart = item->itemText.startOfSelection();
-		// quick hack to always apply on the right frame - pv
-		currentView->deselectItems(true);
-		//CB I dont think we need to draw here. Its faster if we dont.
+		currentView->deselectItems();
 		currentView->selectItem(item, false);
-		// Restore text selection if necessary
-		if (selectionStart >= 0)
+		if (ScCore->primaryMainWindow()->doc->appMode == modeEdit)
 		{
-			item->itemText.deselectAll();
-			item->itemText.select(selectionStart, selectionLength);
-			item->HasSel = true;
+			mode = currentDoc->appMode;
+			currentDoc->appMode = modeNormal;
 		}
-		// Now apply the style.
-		int mode = currentDoc->appMode;
-		currentDoc->appMode = modeEdit;
-		currentWin->setNewParStyle(paraStyleName);
-		currentDoc->appMode = mode;
 	}
-	else // for multiple selection
-	{
-		int mode = currentDoc->appMode;
-		currentDoc->appMode = modeNormal;
-		currentDoc->itemSelection_SetNamedParagraphStyle(paraStyleName);
+
+	currentDoc->itemSelection_SetNamedParagraphStyle(styleName);
+
+	if (mode != modeNormal)
 		currentDoc->appMode = mode;
-	}
 
 	Py_RETURN_NONE;
 }
@@ -724,63 +697,36 @@ PyObject *scribus_setcharstyle(PyObject* /* self */, PyObject* args)
 		return nullptr;
 	}
 
-	// First, find the style number associated with the requested style
-	// by scanning through the styles looking for the name. If
-	// we can't find it, raise PyExc_Exception.
-	// FIXME: Should use a more specific exception.
-	bool found = false;
-	QString charStyleName = QString::fromUtf8(style);
-	// We start at zero here because it's OK to match an internal name
+	QString styleName = QString::fromUtf8(style);
+	QString itemName = QString::fromUtf8(name);
+
 	ScribusDoc*  currentDoc = ScCore->primaryMainWindow()->doc;
 	ScribusView* currentView = ScCore->primaryMainWindow()->view;
-	ScribusMainWindow* currentWin = ScCore->primaryMainWindow();
-	const StyleSet<CharStyle> &docCharStyles = currentDoc->charStyles();
-	int docCharacterStylesCount = docCharStyles.count();
-	for (int i = 0; i < docCharacterStylesCount; ++i)
+
+	if (!currentDoc->charStyles().contains(styleName))
 	{
-		if (docCharStyles[i].name() == charStyleName) {
-			found = true;
-			break;
-		}
-	}
-	if (!found) {
-		// whoops, the user specified an invalid style, complain loudly.
 		PyErr_SetString(NotFoundError, QObject::tr("Character style not found.", "python error").toLocal8Bit().constData());
 		return nullptr;
 	}
-	// for current item only
-	if (currentDoc->m_Selection->isEmpty() || (strlen(name) > 0))
+
+	int mode{modeNormal};
+	bool isCurrentItem = itemName.isEmpty() || itemName == currentDoc->m_Selection->itemAt(0)->itemName();
+
+	if (!isCurrentItem)
 	{
-		// Store text selection as clearing object selection
-		// will also clear text selection
-		int selectionStart = -1;
-		int selectionLength = item->itemText.selectionLength();
-		if (selectionLength > 0)
-			selectionStart = item->itemText.startOfSelection();
-		// quick hack to always apply on the right frame - pv
-		currentView->deselectItems(true);
-		//CB I dont think we need to draw here. Its faster if we dont.
+		currentView->deselectItems();
 		currentView->selectItem(item, false);
-		// Restore text selection if necessary
-		if (selectionStart >= 0)
+		if (ScCore->primaryMainWindow()->doc->appMode == modeEdit)
 		{
-			item->itemText.deselectAll();
-			item->itemText.select(selectionStart, selectionLength);
-			item->HasSel = true;
-		}	
-		// Now apply the style.
-		int mode = ScCore->primaryMainWindow()->doc->appMode;
-		currentDoc->appMode = modeEdit;
-		currentWin->setNewCharStyle(charStyleName);
-		currentDoc->appMode = mode;
+			mode = currentDoc->appMode;
+			currentDoc->appMode = modeNormal;
+		}
 	}
-	else // for multiple selection
-	{
-		int mode = currentDoc->appMode;
-		currentDoc->appMode = modeNormal;
-		currentDoc->itemSelection_SetNamedCharStyle(charStyleName);
+
+	currentDoc->itemSelection_SetNamedCharStyle(styleName);
+
+	if (mode != modeNormal)
 		currentDoc->appMode = mode;
-	}
 
 	Py_RETURN_NONE;
 }
diff --git a/scribus/plugins/scriptplugin/cmdobj.h b/scribus/plugins/scriptplugin/cmdobj.h
index d2296fb41..27a910c7a 100644
--- a/scribus/plugins/scriptplugin/cmdobj.h
+++ b/scribus/plugins/scriptplugin/cmdobj.h
@@ -256,9 +256,9 @@ PyObject *scribus_getstyle(PyObject * /*self*/, PyObject* args);
 PyDoc_STRVAR(scribus_setstyle__doc__,
 QT_TR_NOOP("setStyle(\"style\" [, \"name\"])\n\
 \n\
-Apply the named \"style\" to the object named \"name\". If object name is\n\
-given, style is applied to the current text selection in object \"name\".\n\
-If no object name is given, style is applied on selected object.\n\
+Apply the paragraph style named \"style\".\n\
+If \"name\" is not specified, the current selected item is used.\n\
+If the current item has a text selection, the style is applied to the selection.\n\
 "));
 /**
  Craig Ringer, 2004-09-09
@@ -271,10 +271,10 @@ PyObject *scribus_setstyle(PyObject * /*self*/, PyObject* args);
 /*! docstring */
 PyDoc_STRVAR(scribus_setcharstyle__doc__,
 	QT_TR_NOOP("setCharacterStyle(\"style\" [, \"name\"])\n\
+Apply the character style named \"style\".\n\
+If \"name\" is not specified, the current selected item is used.\n\
+If the current item has a text selection, the style is applied to the selection.\n\
 \n\
-Apply the named character \"style\" to the object named \"name\". If object name is\n\
-given, style is applied to the current text selection in object \"name\".\n\
-If no object name is given, style is applied on selected object.\n\
 "));
 /**
 Apply the named character style to the currently selected object.
