diff --git a/scribus/plugins/scriptplugin/cmdutil.cpp b/scribus/plugins/scriptplugin/cmdutil.cpp
index 7e1b80050..3dce42150 100644
--- a/scribus/plugins/scriptplugin/cmdutil.cpp
+++ b/scribus/plugins/scriptplugin/cmdutil.cpp
@@ -111,6 +111,23 @@ PageItem* GetUniqueItem(const QString& name)
 	return getPageItemByName(name);
 }
 
+PageItem* GetSingleItem(const char* name)
+{
+	return GetSingleItem(QString::fromUtf8(name));
+}
+
+PageItem* GetSingleItem(const QString& name)
+{
+	if (!name.isEmpty())
+		return getPageItemByName(name);
+
+	if (ScCore->primaryMainWindow()->doc->m_Selection->count() == 1)
+		return ScCore->primaryMainWindow()->doc->m_Selection->itemAt(0);
+
+	PyErr_SetString(NoValidObjectError, QString("Please define an item name or select one single item").toLocal8Bit().constData());
+	return nullptr;
+}
+
 PageItem* getPageItemByName(const QString& name)
 {
 	if (name.length() == 0)
diff --git a/scribus/plugins/scriptplugin/cmdutil.h b/scribus/plugins/scriptplugin/cmdutil.h
index 33f785dc2..4c92dfd72 100644
--- a/scribus/plugins/scriptplugin/cmdutil.h
+++ b/scribus/plugins/scriptplugin/cmdutil.h
@@ -43,6 +43,25 @@ void ReplaceColor(const QString& col, const QString& rep);
  */
 PageItem* GetUniqueItem(const QString& name);
 
+/*!
+ * @brief Returns named PageItem, single selection, or set exception and NULL if no item.
+ *
+ * Returns a pointer to a PageItem by looking it up by name - on any page.
+ * If `name' is set, return the matching item or set an exception and return nullptr.
+ * Otherwise, if there is not one single item selected, set an exception and return nullptr
+ * Otherwise, return the selected item.
+ *
+ * @author ale rimoldi
+ */
+PageItem* GetSingleItem(const QString& name);
+
+/*!
+ * @brief call GetSingleItem with a QString
+ *
+ * @author ale rimoldi
+ */
+PageItem* GetSingleItem(const char* name);
+
 /*!
  * @brief Returns named PageItem, or exception and NULL if not found.
  *
